home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / VideoToolboxSources / Luminance.h < prev    next >
MacBinary  |  1995-10-05  |  12.1 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: Luminance.h

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Thu Oct 5 22:49:11 1995, modified Thu Oct 5 22:49:11 1995, creator 'CWIE', type ASCII, 11717 bytes "Luminance.h" , at 0x2e45 456 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 4c 75 6d 69 6e 61 | 6e 63 65 2e 68 00 00 00 |..Lumina|nce.h...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 2d c5 00 | 00 01 c8 ac 9a 49 a7 ac |.....-..|.....I..|
|00000060| 9a 49 a7 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.I......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 0f 16 00 00 |........|........|
|00000080| 2f 2a 0d 4c 75 6d 69 6e | 61 6e 63 65 2e 68 0d 54 |/*.Lumin|ance.h.T|
|00000090| 68 69 73 20 69 73 20 74 | 68 65 20 69 6e 63 6c 75 |his is t|he inclu|
|000000a0| 64 65 20 66 69 6c 65 20 | 66 6f 72 20 4c 75 6d 69 |de file |for Lumi|
|000000b0| 6e 61 6e 63 65 2e 63 20 | 61 6e 64 20 52 65 61 64 |nance.c |and Read|
|000000c0| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 2e |Luminanc|eRecord.|
|000000d0| 63 0d 43 6f 70 79 72 69 | 67 68 74 20 31 39 38 39 |c.Copyri|ght 1989|
|000000e0| 2d 31 39 39 35 20 28 63 | 29 20 44 65 6e 69 73 20 |-1995 (c|) Denis |
|000000f0| 47 2e 20 50 65 6c 6c 69 | 20 0d 48 49 53 54 4f 52 |G. Pelli| .HISTOR|
|00000100| 59 3a 0d 39 2f 31 38 2f | 39 30 09 64 67 70 09 43 |Y:.9/18/|90.dgp.C|
|00000110| 68 61 6e 67 65 64 20 61 | 6c 6c 20 69 6e 73 74 61 |hanged a|ll insta|
|00000120| 6e 63 65 73 20 6f 66 20 | 22 76 22 20 74 6f 20 22 |nces of |"v" to "|
|00000130| 56 22 2e 20 54 68 65 20 | 66 69 6e 61 6c 20 76 65 |V". The |final ve|
|00000140| 72 73 69 6f 6e 20 6f 66 | 20 74 68 65 20 50 65 6c |rsion of| the Pel|
|00000150| 6c 69 0d 09 09 09 26 20 | 5a 68 61 6e 67 20 28 31 |li....& |Zhang (1|
|00000160| 39 39 31 29 20 6d 61 6e | 75 73 63 72 69 70 74 20 |991) man|uscript |
|00000170| 72 65 66 65 72 73 20 74 | 6f 20 61 20 6e 6f 6d 69 |refers t|o a nomi|
|00000180| 6e 61 6c 20 76 6f 6c 74 | 61 67 65 20 76 3b 20 74 |nal volt|age v; t|
|00000190| 68 69 73 20 66 69 6c 65 | 0d 09 09 09 6e 6f 77 20 |his file|....now |
|000001a0| 72 65 66 65 72 73 20 74 | 6f 20 74 68 65 20 22 65 |refers t|o the "e|
|000001b0| 71 75 69 76 61 6c 65 6e | 74 20 6e 75 6d 62 65 72 |quivalen|t number|
|000001c0| 22 20 56 3b 20 74 68 65 | 79 20 61 72 65 20 72 65 |" V; the|y are re|
|000001d0| 6c 61 74 65 64 20 62 79 | 20 56 3d 32 35 35 2a 76 |lated by| V=255*v|
|000001e0| 2e 0d 09 09 09 54 6f 20 | 61 76 6f 69 64 20 22 62 |.....To |avoid "b|
|000001f0| 72 65 61 6b 69 6e 67 22 | 20 61 6c 6c 20 74 68 65 |reaking"| all the|
|00000200| 20 6f 6c 64 20 4c 75 6d | 69 6e 61 6e 63 65 52 65 | old Lum|inanceRe|
|00000210| 63 6f 72 64 2e 68 20 66 | 69 6c 65 73 2c 20 49 27 |cord.h f|iles, I'|
|00000220| 76 65 20 0d 09 09 09 69 | 6e 74 72 6f 64 75 63 65 |ve ....i|ntroduce|
|00000230| 64 20 61 20 23 64 65 66 | 69 6e 65 20 74 68 61 74 |d a #def|ine that|
|00000240| 20 63 6f 6e 76 65 72 74 | 73 20 76 4d 69 6e 20 26 | convert|s vMin &|
|00000250| 20 76 4d 61 78 20 74 6f | 20 56 4d 69 6e 20 26 20 | vMax to| VMin & |
|00000260| 56 4d 61 78 2e 20 48 6f | 77 65 76 65 72 2c 0d 09 |VMax. Ho|wever,..|
|00000270| 09 09 74 68 69 73 20 69 | 73 20 61 20 74 65 6d 70 |..this i|s a temp|
|00000280| 6f 72 61 72 79 20 66 69 | 78 2e 20 49 27 6c 6c 20 |orary fi|x. I'll |
|00000290| 70 72 6f 62 61 62 6c 79 | 20 72 65 6d 6f 76 65 20 |probably| remove |
|000002a0| 74 68 65 20 64 65 66 69 | 6e 65 20 69 6e 20 61 20 |the defi|ne in a |
|000002b0| 66 65 77 20 6d 6f 6e 74 | 68 73 2c 0d 09 09 09 73 |few mont|hs,....s|
|000002c0| 6f 20 79 6f 75 20 73 68 | 6f 75 6c 64 20 73 74 69 |o you sh|ould sti|
|000002d0| 6c 6c 20 75 70 64 61 74 | 65 20 61 6e 79 20 6f 6c |ll updat|e any ol|
|000002e0| 64 20 63 61 6c 69 62 72 | 61 74 69 6f 6e 20 66 69 |d calibr|ation fi|
|000002f0| 6c 65 73 2c 20 65 69 74 | 68 65 72 20 62 79 20 65 |les, eit|her by e|
|00000300| 64 69 74 69 6e 67 2c 0d | 09 09 09 72 65 70 6c 61 |diting,.|...repla|
|00000310| 63 69 6e 67 20 22 76 4d | 22 20 62 79 20 22 56 4d |cing "vM|" by "VM|
|00000320| 22 20 6f 72 20 62 79 20 | 72 65 64 6f 69 6e 67 20 |" or by |redoing |
|00000330| 74 68 65 20 63 61 6c 69 | 62 72 61 74 69 6f 6e 2e |the cali|bration.|
|00000340| 0d 39 2f 32 34 2f 39 30 | 09 64 67 70 09 41 64 64 |.9/24/90|.dgp.Add|
|00000350| 65 64 20 73 63 72 65 65 | 6e 20 26 20 64 61 74 65 |ed scree|n & date|
|00000360| 2e 20 52 65 6e 61 6d 65 | 64 20 6e 42 61 63 6b 67 |. Rename|d nBackg|
|00000370| 72 6f 75 6e 64 20 74 6f | 20 56 42 61 63 6b 67 72 |round to| VBackgr|
|00000380| 6f 75 6e 64 2e 0d 09 09 | 09 52 65 6e 61 6d 65 64 |ound....|.Renamed|
|00000390| 20 69 6e 64 65 78 20 74 | 6f 20 6c 61 73 74 49 6e | index t|o lastIn|
|000003a0| 64 65 78 2e 0d 39 2f 32 | 38 2f 39 30 09 64 67 70 |dex..9/2|8/90.dgp|
|000003b0| 09 52 65 6e 61 6d 65 64 | 20 6c 61 73 74 49 6e 64 |.Renamed| lastInd|
|000003c0| 65 78 20 74 6f 20 6c 61 | 74 65 73 74 49 6e 64 65 |ex to la|testInde|
|000003d0| 78 2e 20 53 70 72 75 63 | 65 64 20 75 70 20 73 6f |x. Spruc|ed up so|
|000003e0| 6d 65 20 6f 66 20 74 68 | 65 20 63 6f 6d 6d 65 6e |me of th|e commen|
|000003f0| 74 73 2e 0d 31 30 2f 33 | 31 2f 39 30 20 64 67 70 |ts..10/3|1/90 dgp|
|00000400| 20 41 64 64 65 64 20 74 | 68 65 20 63 6f 6e 64 69 | Added t|he condi|
|00000410| 74 69 6f 6e 61 6c 20 46 | 41 53 54 5f 4c 55 4d 49 |tional F|AST_LUMI|
|00000420| 4e 41 4e 43 45 2e 20 53 | 65 74 74 69 6e 67 20 69 |NANCE. S|etting i|
|00000430| 74 20 74 6f 20 31 20 28 | 74 72 75 65 29 20 6d 61 |t to 1 (|true) ma|
|00000440| 6b 65 73 0d 09 09 09 53 | 65 74 4c 75 6d 69 6e 61 |kes....S|etLumina|
|00000450| 6e 63 65 73 41 6e 64 52 | 61 6e 67 65 28 29 20 72 |ncesAndR|ange() r|
|00000460| 75 6e 20 74 77 69 63 65 | 20 61 73 20 66 61 73 74 |un twice| as fast|
|00000470| 2c 20 62 79 20 75 73 69 | 6e 67 20 66 69 78 65 64 |, by usi|ng fixed|
|00000480| 20 70 6f 69 6e 74 0d 09 | 09 09 61 72 69 74 68 6d | point..|..arithm|
|00000490| 65 74 69 63 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |etic ins|tead of |
|000004a0| 64 6f 75 62 6c 65 73 2e | 20 53 65 74 74 69 6e 67 |doubles.| Setting|
|000004b0| 20 69 74 20 74 6f 20 30 | 20 28 66 61 6c 73 65 29 | it to 0| (false)|
|000004c0| 20 63 61 75 73 65 73 20 | 74 68 65 0d 09 09 09 73 | causes |the....s|
|000004d0| 61 6d 65 20 63 6f 64 65 | 20 74 6f 20 62 65 20 63 |ame code| to be c|
|000004e0| 6f 6d 70 69 6c 65 64 20 | 74 6f 20 75 73 65 20 64 |ompiled |to use d|
|000004f0| 6f 75 62 6c 65 73 2e 20 | 4e 6f 74 65 20 74 68 61 |oubles. |Note tha|
|00000500| 74 20 74 68 65 20 70 72 | 6f 74 6f 74 79 70 65 73 |t the pr|ototypes|
|00000510| 20 6f 66 0d 09 09 09 73 | 6f 6d 65 20 69 6e 74 65 | of....s|ome inte|
|00000520| 72 6e 61 6c 20 66 75 6e | 63 74 69 6f 6e 73 20 28 |rnal fun|ctions (|
|00000530| 6e 61 6d 65 73 20 62 65 | 67 69 6e 6e 69 6e 67 20 |names be|ginning |
|00000540| 77 69 74 68 20 75 6e 64 | 65 72 73 63 6f 72 65 29 |with und|erscore)|
|00000550| 20 61 72 65 20 63 6f 6e | 64 69 74 69 6f 6e 61 6c | are con|ditional|
|00000560| 0d 09 09 09 6f 6e 20 46 | 41 53 54 5f 4c 55 4d 49 |....on F|AST_LUMI|
|00000570| 4e 41 4e 43 45 2e 0d 31 | 31 2f 36 2f 39 30 20 64 |NANCE..1|1/6/90 d|
|00000580| 67 70 20 52 65 70 6c 61 | 63 65 64 20 4d 69 6c 6c |gp Repla|ced Mill|
|00000590| 69 20 62 79 20 46 69 78 | 65 64 2e 20 0d 31 31 2f |i by Fix|ed. .11/|
|000005a0| 38 2f 39 30 20 64 67 70 | 09 45 6c 69 6d 69 6e 61 |8/90 dgp|.Elimina|
|000005b0| 74 65 64 20 67 61 6d 6d | 61 20 73 6c 6f 70 65 20 |ted gamm|a slope |
|000005c0| 74 61 62 6c 65 20 73 68 | 69 66 74 65 64 4c 53 6c |table sh|iftedLSl|
|000005d0| 6f 70 65 5b 5d 20 73 69 | 6e 63 65 20 74 68 65 20 |ope[] si|nce the |
|000005e0| 73 70 65 65 64 2d 75 70 | 20 69 74 20 6f 66 66 65 |speed-up| it offe|
|000005f0| 72 65 64 0d 09 09 09 77 | 61 73 20 74 6f 6f 20 73 |red....w|as too s|
|00000600| 6d 61 6c 6c 20 74 6f 20 | 6d 65 61 73 75 72 65 2e |mall to |measure.|
|00000610| 0d 37 2f 33 30 2f 39 31 | 09 64 67 70 09 41 64 64 |.7/30/91|.dgp.Add|
|00000620| 65 64 20 70 72 6f 74 6f | 74 79 70 65 20 66 6f 72 |ed proto|type for|
|00000630| 20 52 65 61 64 4c 75 6d | 69 6e 61 6e 63 65 52 65 | ReadLum|inanceRe|
|00000640| 63 6f 72 64 28 29 2e 0d | 38 2f 34 2f 39 31 09 64 |cord()..|8/4/91.d|
|00000650| 67 70 09 43 68 61 6e 67 | 65 20 52 65 61 64 4c 75 |gp.Chang|e ReadLu|
|00000660| 6d 69 6e 61 6e 63 65 52 | 65 63 6f 72 64 28 29 20 |minanceR|ecord() |
|00000670| 74 6f 20 72 65 74 75 72 | 6e 20 74 79 70 65 20 69 |to retur|n type i|
|00000680| 6e 74 2e 0d 38 2f 35 2f | 39 31 09 64 67 70 09 54 |nt..8/5/|91.dgp.T|
|00000690| 72 79 69 6e 67 20 74 6f | 20 63 6f 6d 70 69 6c 65 |rying to| compile|
|000006a0| 20 75 6e 64 65 72 20 4d | 50 57 20 43 20 33 2e 32 | under M|PW C 3.2|
|000006b0| 20 75 6e 63 6f 76 65 72 | 65 64 20 61 20 6e 61 6d | uncover|ed a nam|
|000006c0| 65 2d 73 70 61 63 65 20 | 63 6f 6e 66 6c 69 63 74 |e-space |conflict|
|000006d0| 2e 0d 09 09 09 54 68 65 | 20 4d 50 57 20 43 20 33 |.....The| MPW C 3|
|000006e0| 2e 32 20 43 54 79 70 65 | 2e 68 20 68 65 61 64 65 |.2 CType|.h heade|
|000006f0| 72 20 66 69 6c 65 20 64 | 65 66 69 6e 65 73 20 5f |r file d|efines _|
|00000700| 4c 20 61 73 20 61 20 70 | 72 65 70 72 6f 63 65 73 |L as a p|reproces|
|00000710| 73 6f 72 20 63 6f 6e 73 | 74 61 6e 74 2c 0d 09 09 |sor cons|tant,...|
|00000720| 09 77 68 65 72 65 61 73 | 20 4c 75 6d 69 6e 61 6e |.whereas| Luminan|
|00000730| 63 65 2e 68 20 75 73 65 | 73 20 69 74 20 61 73 20 |ce.h use|s it as |
|00000740| 61 20 66 69 65 6c 64 20 | 6f 66 20 74 68 65 20 4c |a field |of the L|
|00000750| 75 6d 69 6e 61 6e 63 65 | 54 61 62 6c 65 20 73 74 |uminance|Table st|
|00000760| 72 75 63 74 75 72 65 2c | 0d 09 09 09 61 6e 64 20 |ructure,|....and |
|00000770| 61 73 20 61 20 70 61 72 | 61 6d 65 74 65 72 20 6e |as a par|ameter n|
|00000780| 61 6d 65 2e 0d 09 09 09 | 54 68 65 20 54 48 49 4e |ame.....|The THIN|
|00000790| 4b 20 43 20 34 2e 30 35 | 20 63 74 79 70 65 2e 68 |K C 4.05| ctype.h|
|000007a0| 20 68 65 61 64 65 72 20 | 66 69 6c 65 20 6e 61 6d | header |file nam|
|000007b0| 65 73 20 74 68 65 20 73 | 61 6d 65 20 63 6f 6e 73 |es the s|ame cons|
|000007c0| 74 61 6e 74 20 5f 5f 4c | 4f 57 52 2c 0d 09 09 09 |tant __L|OWR,....|
|000007d0| 77 68 69 63 68 20 6f 66 | 20 63 6f 75 72 73 65 20 |which of| course |
|000007e0| 64 6f 65 73 6e 27 74 20 | 63 6f 6e 66 6c 69 63 74 |doesn't |conflict|
|000007f0| 2e 20 54 68 65 20 6f 62 | 76 69 6f 75 73 20 73 6f |. The ob|vious so|
|00000800| 6c 75 74 69 6f 6e 20 77 | 6f 75 6c 64 20 62 65 20 |lution w|ould be |
|00000810| 74 6f 0d 09 09 09 63 68 | 61 6e 67 65 20 4d 50 57 |to....ch|ange MPW|
|00000820| 27 73 20 43 54 79 70 65 | 2e 68 20 5f 4c 20 74 6f |'s CType|.h _L to|
|00000830| 20 5f 4c 4f 57 52 2c 20 | 62 75 74 20 74 68 61 74 | _LOWR, |but that|
|00000840| 20 77 6f 75 6c 64 20 63 | 6f 6d 70 72 6f 6d 69 73 | would c|ompromis|
|00000850| 65 20 70 6f 72 74 61 62 | 69 6c 69 74 79 2e 0d 09 |e portab|ility...|
|00000860| 09 09 49 20 64 65 63 69 | 64 65 64 20 6e 6f 74 20 |..I deci|ded not |
|00000870| 74 6f 20 63 68 61 6e 67 | 65 20 5f 4c 20 69 6e 20 |to chang|e _L in |
|00000880| 4c 75 6d 69 6e 61 6e 63 | 65 2e 68 20 61 6e 64 20 |Luminanc|e.h and |
|00000890| 4c 75 6d 69 6e 61 6e 63 | 65 2e 63 2c 0d 09 09 09 |Luminanc|e.c,....|
|000008a0| 62 65 63 61 75 73 65 20 | 69 74 20 77 6f 75 6c 64 |because |it would|
|000008b0| 20 62 65 20 68 61 72 64 | 20 74 6f 20 64 6f 20 74 | be hard| to do t|
|000008c0| 68 61 74 20 69 6e 20 61 | 20 77 61 79 20 74 68 61 |hat in a| way tha|
|000008d0| 74 20 77 6f 75 6c 64 6e | 27 74 20 63 6f 6d 70 72 |t wouldn|'t compr|
|000008e0| 6f 6d 69 73 65 20 0d 09 | 09 09 74 68 65 20 72 65 |omise ..|..the re|
|000008f0| 61 64 61 62 69 6c 69 74 | 79 20 6f 66 20 74 68 65 |adabilit|y of the|
|00000900| 20 63 6f 64 65 2e 20 48 | 6f 77 65 76 65 72 2c 20 | code. H|owever, |
|00000910| 49 20 64 69 64 20 64 6f | 20 61 20 71 75 69 63 6b |I did do| a quick|
|00000920| 20 68 61 63 6b 2c 20 0d | 09 09 09 61 62 6f 75 74 | hack, .|...about|
|00000930| 20 74 65 6e 20 6c 69 6e | 65 73 20 62 65 6c 6f 77 | ten lin|es below|
|00000940| 2c 20 74 68 61 74 20 72 | 65 64 65 66 69 6e 65 73 |, that r|edefines|
|00000950| 20 5f 4c 20 61 73 20 61 | 6e 20 65 6e 75 6d 2c 20 | _L as a|n enum, |
|00000960| 77 68 69 63 68 20 73 6f | 6c 76 65 73 20 74 68 65 |which so|lves the|
|00000970| 0d 09 09 09 70 72 6f 62 | 6c 65 6d 2c 20 70 72 6f |....prob|lem, pro|
|00000980| 76 69 64 65 64 20 43 54 | 79 70 65 2e 68 20 69 73 |vided CT|ype.h is|
|00000990| 20 69 6e 63 6c 75 64 65 | 64 20 62 65 66 6f 72 65 | include|d before|
|000009a0| 20 4c 75 6d 69 6e 61 6e | 63 65 2e 68 20 69 6e 20 | Luminan|ce.h in |
|000009b0| 66 69 6c 65 73 20 74 68 | 61 74 0d 09 09 09 6e 65 |files th|at....ne|
|000009c0| 65 64 20 74 6f 20 65 78 | 70 6c 69 63 69 74 6c 79 |ed to ex|plicitly|
|000009d0| 20 61 63 63 65 73 73 20 | 5f 4c 2e 20 49 6e 20 66 | access |_L. In f|
|000009e0| 61 63 74 20 5f 4c 20 69 | 73 20 69 6e 74 65 6e 64 |act _L i|s intend|
|000009f0| 65 64 20 66 6f 72 20 75 | 73 65 0d 09 09 09 6f 6e |ed for u|se....on|
|00000a00| 6c 79 20 62 79 20 74 68 | 65 20 72 6f 75 74 69 6e |ly by th|e routin|
|00000a10| 65 73 20 74 68 61 74 20 | 61 72 65 20 69 6e 20 4c |es that |are in L|
|00000a20| 75 6d 69 6e 61 6e 63 65 | 2e 63 2c 20 73 6f 20 49 |uminance|.c, so I|
|00000a30| 20 73 75 73 70 65 63 74 | 20 74 68 65 0d 09 09 09 | suspect| the....|
|00000a40| 70 72 6f 62 6c 65 6d 20 | 69 73 20 73 6f 6c 76 65 |problem |is solve|
|00000a50| 64 2e 0d 31 32 2f 31 37 | 2f 39 32 09 64 67 70 20 |d..12/17|/92.dgp |
|00000a60| 52 65 6d 6f 76 65 64 20 | 6f 62 73 6f 6c 65 74 65 |Removed |obsolete|
|00000a70| 20 73 75 70 70 6f 72 74 | 20 66 6f 72 20 54 48 49 | support| for THI|
|00000a80| 4e 4b 20 43 20 34 2e 20 | 0d 31 32 2f 32 31 2f 39 |NK C 4. |.12/21/9|
|00000a90| 32 20 64 67 70 20 41 64 | 64 65 64 20 64 61 63 53 |2 dgp Ad|ded dacS|
|00000aa0| 69 7a 65 20 61 6e 64 20 | 6c 65 66 74 53 68 69 66 |ize and |leftShif|
|00000ab0| 74 2e 0d 36 2f 35 2f 39 | 33 09 64 67 70 09 52 65 |t..6/5/9|3.dgp.Re|
|00000ac0| 6d 6f 76 65 64 20 74 68 | 65 20 61 6e 63 69 65 6e |moved th|e ancien|
|00000ad0| 74 20 23 64 65 66 69 6e | 65 73 20 74 68 61 74 20 |t #defin|es that |
|00000ae0| 77 65 72 65 20 72 65 71 | 75 69 72 65 64 20 74 6f |were req|uired to|
|00000af0| 20 72 65 61 64 20 b2 31 | 39 39 30 20 63 61 6c 69 | read .1|990 cali|
|00000b00| 62 72 61 74 69 6f 6e 0d | 09 09 09 66 69 6c 65 73 |bration.|...files|
|00000b10| 2e 0d 38 2f 31 32 2f 39 | 33 09 64 67 70 09 75 70 |..8/12/9|3.dgp.up|
|00000b20| 64 61 74 65 64 20 52 65 | 61 64 4c 75 6d 69 6e 61 |dated Re|adLumina|
|00000b30| 6e 63 65 52 65 63 6f 72 | 64 28 29 20 70 72 6f 74 |nceRecor|d() prot|
|00000b40| 6f 74 79 70 65 20 74 6f | 20 6d 61 74 63 68 20 73 |otype to| match s|
|00000b50| 6f 75 72 63 65 20 66 69 | 6c 65 2e 0d 38 2f 31 2f |ource fi|le..8/1/|
|00000b60| 39 34 09 64 67 70 20 52 | 65 6e 61 6d 65 64 20 22 |94.dgp R|enamed "|
|00000b70| 5f 4c 22 20 74 6f 20 22 | 5f 4c 75 22 20 74 6f 20 |_L" to "|_Lu" to |
|00000b80| 61 76 6f 69 64 20 63 6f | 6e 66 6c 69 63 74 20 77 |avoid co|nflict w|
|00000b90| 69 74 68 20 5f 4c 28 29 | 20 6d 61 63 72 6f 20 64 |ith _L()| macro d|
|00000ba0| 65 66 69 6e 65 64 20 69 | 6e 20 66 70 2e 68 2e 0d |efined i|n fp.h..|
|00000bb0| 31 30 2f 31 37 2f 39 34 | 20 64 67 70 20 63 61 70 |10/17/94| dgp cap|
|00000bc0| 69 74 61 6c 69 7a 65 64 | 20 6c 75 6d 69 6e 61 6e |italized| luminan|
|00000bd0| 63 65 52 65 63 6f 72 64 | 20 74 6f 20 4c 75 6d 69 |ceRecord| to Lumi|
|00000be0| 6e 61 6e 63 65 52 65 63 | 6f 72 64 2c 20 62 75 74 |nanceRec|ord, but|
|00000bf0| 20 72 65 74 61 69 6e 65 | 64 20 61 20 74 79 70 65 | retaine|d a type|
|00000c00| 64 65 66 0d 09 09 09 6f | 66 20 6f 6c 64 20 66 6f |def....o|f old fo|
|00000c10| 72 20 62 61 63 6b 77 61 | 72 64 20 63 6f 6d 70 61 |r backwa|rd compa|
|00000c20| 74 69 62 69 6c 69 74 79 | 2e 0d 34 2f 33 30 2f 39 |tibility|..4/30/9|
|00000c30| 35 20 64 67 70 20 63 61 | 70 69 74 61 6c 69 7a 65 |5 dgp ca|pitalize|
|00000c40| 64 20 6c 75 6d 69 6e 61 | 6e 63 65 54 61 62 6c 65 |d lumina|nceTable|
|00000c50| 20 74 6f 20 4c 75 6d 69 | 6e 61 6e 63 65 54 61 62 | to Lumi|nanceTab|
|00000c60| 6c 65 2c 20 62 75 74 20 | 72 65 74 61 69 6e 65 64 |le, but |retained|
|00000c70| 20 61 20 74 79 70 65 64 | 65 66 0d 09 09 09 6f 66 | a typed|ef....of|
|00000c80| 20 6f 6c 64 20 66 6f 72 | 20 62 61 63 6b 77 61 72 | old for| backwar|
|00000c90| 64 20 63 6f 6d 70 61 74 | 69 62 69 6c 69 74 79 2e |d compat|ibility.|
|00000ca0| 0d 2a 2f 0d 0d 23 70 72 | 61 67 6d 61 20 6f 6e 63 |.*/..#pr|agma onc|
|00000cb0| 65 09 09 2f 2a 20 73 75 | 70 70 72 65 73 73 20 6d |e../* su|ppress m|
|00000cc0| 75 6c 74 69 70 6c 65 20 | 69 6e 63 6c 75 73 69 6f |ultiple |inclusio|
|00000cd0| 6e 73 20 6f 66 20 74 68 | 69 73 20 66 69 6c 65 20 |ns of th|is file |
|00000ce0| 2a 2f 0d 23 69 66 6e 64 | 65 66 20 5f 4c 55 4d 49 |*/.#ifnd|ef _LUMI|
|00000cf0| 4e 41 4e 43 45 5f 09 2f | 2a 20 73 75 70 70 72 65 |NANCE_./|* suppre|
|00000d00| 73 73 20 6d 75 6c 74 69 | 70 6c 65 20 69 6e 63 6c |ss multi|ple incl|
|00000d10| 75 73 69 6f 6e 73 20 6f | 66 20 74 68 69 73 20 66 |usions o|f this f|
|00000d20| 69 6c 65 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 5f |ile */.#|define _|
|00000d30| 4c 55 4d 49 4e 41 4e 43 | 45 5f 0d 0d 23 69 66 6e |LUMINANC|E_..#ifn|
|00000d40| 64 65 66 20 5f 5f 51 55 | 49 43 4b 44 52 41 57 5f |def __QU|ICKDRAW_|
|00000d50| 5f 0d 09 23 69 6e 63 6c | 75 64 65 20 3c 51 75 69 |_..#incl|ude <Qui|
|00000d60| 63 6b 44 72 61 77 2e 68 | 3e 0d 23 65 6e 64 69 66 |ckDraw.h|>.#endif|
|00000d70| 0d 23 69 66 6e 64 65 66 | 20 5f 5f 53 4f 55 4e 44 |.#ifndef| __SOUND|
|00000d80| 5f 5f 0d 09 23 69 6e 63 | 6c 75 64 65 20 3c 53 6f |__..#inc|lude <So|
|00000d90| 75 6e 64 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 0d 2f |und.h>.#|endif../|
|00000da0| 2a 20 4c 49 4e 45 41 52 | 5f 56 5f 44 4f 4d 41 49 |* LINEAR|_V_DOMAI|
|00000db0| 4e 20 69 73 20 74 68 65 | 20 6d 61 78 69 6d 75 6d |N is the| maximum|
|00000dc0| 20 69 6e 74 65 72 76 61 | 6c 20 69 6e 20 56 20 6f | interva|l in V o|
|00000dd0| 76 65 72 20 77 68 69 63 | 68 20 74 68 65 20 67 61 |ver whic|h the ga|
|00000de0| 6d 6d 61 20 66 75 6e 63 | 74 69 6f 6e 20 69 73 0d |mma func|tion is.|
|00000df0| 74 6f 20 62 65 20 61 73 | 73 75 6d 65 64 20 6c 69 |to be as|sumed li|
|00000e00| 6e 65 61 72 20 62 79 20 | 4c 54 6f 56 28 29 2e 20 |near by |LToV(). |
|00000e10| 54 68 65 20 76 61 6c 75 | 65 20 34 20 67 69 76 65 |The valu|e 4 give|
|00000e20| 73 20 61 6c 6d 6f 73 74 | 20 74 68 65 20 73 61 6d |s almost| the sam|
|00000e30| 65 20 61 63 63 75 72 61 | 63 79 20 61 73 20 31 2c |e accura|cy as 1,|
|00000e40| 20 79 65 74 0d 72 65 73 | 75 6c 74 73 20 69 6e 20 | yet.res|ults in |
|00000e50| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 73 28 29 20 |SetLumin|ances() |
|00000e60| 6f 6e 20 61 20 4d 61 63 | 20 49 49 20 74 61 6b 69 |on a Mac| II taki|
|00000e70| 6e 67 20 6f 6e 6c 79 20 | 32 39 20 6d 73 20 69 6e |ng only |29 ms in|
|00000e80| 73 74 65 61 64 20 6f 66 | 20 35 30 20 6d 73 2e 20 |stead of| 50 ms. |
|00000e90| 0d 53 65 65 20 5f 4c 54 | 6f 56 28 29 20 69 6e 20 |.See _LT|oV() in |
|00000ea0| 4c 75 6d 69 6e 61 6e 63 | 65 2e 63 20 20 66 6f 72 |Luminanc|e.c for|
|00000eb0| 20 6d 6f 72 65 20 69 6e | 66 6f 72 6d 61 74 69 6f | more in|formatio|
|00000ec0| 6e 2e 20 2a 2f 0d 0d 23 | 64 65 66 69 6e 65 20 4d |n. */..#|define M|
|00000ed0| 41 43 49 4e 54 4f 53 48 | 09 31 09 09 2f 2a 20 73 |ACINTOSH|.1../* s|
|00000ee0| 65 74 20 74 6f 20 30 20 | 74 6f 20 75 73 65 20 6f |et to 0 |to use o|
|00000ef0| 6e 20 61 6e 79 20 6f 74 | 68 65 72 20 63 6f 6d 70 |n any ot|her comp|
|00000f00| 75 74 65 72 20 2a 2f 0d | 23 64 65 66 69 6e 65 20 |uter */.|#define |
|00000f10| 4c 49 4e 45 41 52 5f 56 | 5f 44 4f 4d 41 49 4e 20 |LINEAR_V|_DOMAIN |
|00000f20| 34 09 2f 2a 20 73 65 65 | 20 61 62 6f 76 65 20 2a |4./* see| above *|
|00000f30| 2f 0d 23 64 65 66 69 6e | 65 20 46 41 53 54 5f 4c |/.#defin|e FAST_L|
|00000f40| 55 4d 49 4e 41 4e 43 45 | 20 31 09 2f 2a 20 31 20 |UMINANCE| 1./* 1 |
|00000f50| 66 6f 72 20 46 69 78 65 | 64 20 6d 61 74 68 20 28 |for Fixe|d math (|
|00000f60| 74 77 69 63 65 20 61 73 | 20 66 61 73 74 29 2c 20 |twice as| fast), |
|00000f70| 30 20 66 6f 72 20 64 6f | 75 62 6c 65 20 6d 61 74 |0 for do|uble mat|
|00000f80| 68 20 2a 2f 0d 23 64 65 | 66 69 6e 65 20 44 41 43 |h */.#de|fine DAC|
|00000f90| 53 20 33 09 09 09 09 2f | 2a 20 6e 75 6d 62 65 72 |S 3..../|* number|
|00000fa0| 20 6f 66 20 64 69 67 69 | 74 61 6c 2d 74 6f 2d 61 | of digi|tal-to-a|
|00000fb0| 6e 61 6c 6f 67 20 63 6f | 6e 76 65 72 74 65 72 73 |nalog co|nverters|
|00000fc0| 20 74 68 61 74 20 77 65 | 20 73 75 70 70 6f 72 74 | that we| support|
|00000fd0| 20 2a 2f 0d 23 64 65 66 | 69 6e 65 20 43 4f 4c 4f | */.#def|ine COLO|
|00000fe0| 52 53 20 32 35 36 09 09 | 09 2f 2a 20 73 69 7a 65 |RS 256..|./* size|
|00000ff0| 20 6f 66 20 43 6f 6c 6f | 72 53 70 65 63 20 74 61 | of Colo|rSpec ta|
|00001000| 62 6c 65 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 4d |ble */.#|define M|
|00001010| 41 58 5f 43 4f 45 46 46 | 49 43 49 45 4e 54 53 20 |AX_COEFF|ICIENTS |
|00001020| 39 09 2f 2a 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 20 |9./* pol|ynomial |
|00001030| 66 69 74 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 4c |fit */.#|define L|
|00001040| 55 4d 49 4e 41 4e 43 45 | 53 5f 49 4e 5f 54 41 42 |UMINANCE|S_IN_TAB|
|00001050| 4c 45 20 31 32 38 09 2f | 2a 20 73 69 7a 65 20 6f |LE 128./|* size o|
|00001060| 66 20 67 61 6d 6d 61 20 | 74 61 62 6c 65 20 2a 2f |f gamma |table */|
|00001070| 0d 0d 23 69 66 20 46 41 | 53 54 5f 4c 55 4d 49 4e |..#if FA|ST_LUMIN|
|00001080| 41 4e 43 45 20 26 20 21 | 64 65 66 69 6e 65 64 28 |ANCE & !|defined(|
|00001090| 5f 5f 54 4f 4f 4c 55 54 | 49 4c 53 5f 5f 29 0d 09 |__TOOLUT|ILS__)..|
|000010a0| 23 69 6e 63 6c 75 64 65 | 20 3c 54 6f 6f 6c 55 74 |#include| <ToolUt|
|000010b0| 69 6c 73 2e 68 3e 09 2f | 2a 20 70 72 6f 74 6f 74 |ils.h>./|* protot|
|000010c0| 79 70 65 73 20 66 6f 72 | 20 46 69 78 4d 75 6c 20 |ypes for| FixMul |
|000010d0| 65 74 63 2e 20 2a 2f 0d | 23 65 6e 64 69 66 0d 0d |etc. */.|#endif..|
|000010e0| 74 79 70 65 64 65 66 20 | 73 74 72 75 63 74 7b 0d |typedef |struct{.|
|000010f0| 09 43 6f 6c 6f 72 53 70 | 65 63 20 74 61 62 6c 65 |.ColorSp|ec table|
|00001100| 5b 43 4f 4c 4f 52 53 5d | 3b 09 2f 2a 20 61 20 74 |[COLORS]|;./* a t|
|00001110| 61 62 6c 65 20 6f 66 20 | 76 61 6c 75 65 73 20 64 |able of |values d|
|00001120| 65 73 74 69 6e 65 64 20 | 66 6f 72 20 74 68 65 20 |estined |for the |
|00001130| 63 6c 75 74 20 2a 2f 0d | 7d 20 43 6c 75 74 3b 0d |clut */.|} Clut;.|
|00001140| 0d 65 6e 75 6d 20 7b 4d | 69 63 68 65 6c 73 6f 6e |.enum {M|ichelson|
|00001150| 2c 57 65 62 65 72 7d 3b | 09 2f 2a 20 63 6f 6e 74 |,Weber};|./* cont|
|00001160| 72 61 73 74 54 79 70 65 | 20 2a 2f 0d 0d 74 79 70 |rastType| */..typ|
|00001170| 65 64 65 66 20 73 74 72 | 75 63 74 20 7b 0d 09 73 |edef str|uct {..s|
|00001180| 68 6f 72 74 20 65 78 69 | 73 74 73 3b 09 2f 2a 20 |hort exi|sts;./* |
|00001190| 73 65 74 20 74 6f 20 6c | 75 6d 69 6e 61 6e 63 65 |set to l|uminance|
|000011a0| 53 65 74 20 6f 6e 63 65 | 20 74 68 69 73 20 74 61 |Set once| this ta|
|000011b0| 62 6c 65 20 68 61 73 20 | 62 65 65 6e 20 69 6e 69 |ble has |been ini|
|000011c0| 74 69 61 6c 69 7a 65 64 | 20 2a 2f 0d 09 73 68 6f |tialized| */..sho|
|000011d0| 72 74 20 6c 61 74 65 73 | 74 49 6e 64 65 78 3b 2f |rt lates|tIndex;/|
|000011e0| 2a 20 6c 61 73 74 2d 75 | 73 65 64 20 69 6e 64 65 |* last-u|sed inde|
|000011f0| 78 20 6f 66 20 4c 52 2e | 4c 2e 5f 4c 75 5b 5d 20 |x of LR.|L._Lu[] |
|00001200| 69 73 20 67 6f 6f 64 20 | 70 6c 61 63 65 20 74 6f |is good |place to|
|00001210| 20 73 74 61 72 74 20 73 | 65 61 72 63 68 20 2a 2f | start s|earch */|
|00001220| 0d 09 23 69 66 20 46 41 | 53 54 5f 4c 55 4d 49 4e |..#if FA|ST_LUMIN|
|00001230| 41 4e 43 45 0d 09 09 46 | 69 78 65 64 20 5f 56 4d |ANCE...F|ixed _VM|
|00001240| 69 6e 3b 09 2f 2a 20 62 | 6f 75 6e 64 73 20 6d 6f |in;./* b|ounds mo|
|00001250| 6e 6f 74 6f 6e 69 63 20 | 70 61 72 74 20 6f 66 20 |notonic |part of |
|00001260| 64 6f 6d 61 69 6e 20 6f | 66 20 67 61 6d 6d 61 20 |domain o|f gamma |
|00001270| 66 75 6e 63 74 69 6f 6e | 20 2a 2f 0d 09 09 46 69 |function| */...Fi|
|00001280| 78 65 64 20 5f 56 4d 61 | 78 3b 09 2f 2a 20 62 6f |xed _VMa|x;./* bo|
|00001290| 75 6e 64 73 20 6d 6f 6e | 6f 74 6f 6e 69 63 20 70 |unds mon|otonic p|
|000012a0| 61 72 74 20 6f 66 20 64 | 6f 6d 61 69 6e 20 6f 66 |art of d|omain of|
|000012b0| 20 67 61 6d 6d 61 20 66 | 75 6e 63 74 69 6f 6e 20 | gamma f|unction |
|000012c0| 2a 2f 0d 09 09 46 69 78 | 65 64 20 5f 64 56 3b 09 |*/...Fix|ed _dV;.|
|000012d0| 09 2f 2a 20 56 20 3d 20 | 5f 56 4d 69 6e 2c 5f 56 |./* V = |_VMin,_V|
|000012e0| 4d 69 6e 2b 5f 64 56 2c | 5f 56 4d 69 6e 2b 32 64 |Min+_dV,|_VMin+2d|
|000012f0| 56 2c 5f 56 4d 69 6e 2b | 33 64 56 2c 20 2e 20 2e |V,_VMin+|3dV, . .|
|00001300| 20 2e 20 2c 5f 56 4d 61 | 78 20 2a 2f 0d 09 09 09 | . ,_VMa|x */....|
|00001310| 09 09 09 2f 2a 20 5f 64 | 56 3d 28 5f 56 4d 61 78 |.../* _d|V=(_VMax|
|00001320| 2d 5f 56 4d 69 6e 29 2f | 28 4c 55 4d 49 4e 41 4e |-_VMin)/|(LUMINAN|
|00001330| 43 45 53 5f 49 4e 5f 54 | 41 42 4c 45 2d 31 29 20 |CES_IN_T|ABLE-1) |
|00001340| 2a 2f 0d 09 09 46 69 78 | 65 64 20 5f 4c 75 5b 4c |*/...Fix|ed _Lu[L|
|00001350| 55 4d 49 4e 41 4e 43 45 | 53 5f 49 4e 5f 54 41 42 |UMINANCE|S_IN_TAB|
|00001360| 4c 45 5d 3b 0d 09 09 6c | 6f 6e 67 20 4c 53 68 69 |LE];...l|ong LShi|
|00001370| 66 74 3b 09 2f 2a 20 62 | 69 74 20 73 68 69 66 74 |ft;./* b|it shift|
|00001380| 20 74 6f 20 62 65 20 61 | 70 70 6c 69 65 64 20 74 | to be a|pplied t|
|00001390| 6f 20 6c 75 6d 69 6e 61 | 6e 63 65 20 64 69 66 66 |o lumina|nce diff|
|000013a0| 65 72 65 6e 63 65 73 20 | 2a 2f 0d 09 23 65 6c 73 |erences |*/..#els|
|000013b0| 65 0d 09 09 64 6f 75 62 | 6c 65 20 5f 56 4d 69 6e |e...doub|le _VMin|
|000013c0| 3b 09 2f 2a 20 62 6f 75 | 6e 64 73 20 6d 6f 6e 6f |;./* bou|nds mono|
|000013d0| 74 6f 6e 69 63 20 70 61 | 72 74 20 6f 66 20 64 6f |tonic pa|rt of do|
|000013e0| 6d 61 69 6e 20 6f 66 20 | 67 61 6d 6d 61 20 66 75 |main of |gamma fu|
|000013f0| 6e 63 74 69 6f 6e 20 2a | 2f 0d 09 09 64 6f 75 62 |nction *|/...doub|
|00001400| 6c 65 20 5f 56 4d 61 78 | 3b 09 2f 2a 20 62 6f 75 |le _VMax|;./* bou|
|00001410| 6e 64 73 20 6d 6f 6e 6f | 74 6f 6e 69 63 20 70 61 |nds mono|tonic pa|
|00001420| 72 74 20 6f 66 20 64 6f | 6d 61 69 6e 20 6f 66 20 |rt of do|main of |
|00001430| 67 61 6d 6d 61 20 66 75 | 6e 63 74 69 6f 6e 20 2a |gamma fu|nction *|
|00001440| 2f 0d 09 09 64 6f 75 62 | 6c 65 20 5f 64 56 3b 09 |/...doub|le _dV;.|
|00001450| 09 2f 2a 20 56 20 3d 20 | 5f 56 4d 69 6e 2c 5f 56 |./* V = |_VMin,_V|
|00001460| 4d 69 6e 2b 5f 64 56 2c | 5f 56 4d 69 6e 2b 32 64 |Min+_dV,|_VMin+2d|
|00001470| 56 2c 5f 56 4d 69 6e 2b | 33 64 56 2c 20 2e 20 2e |V,_VMin+|3dV, . .|
|00001480| 20 2e 20 2c 5f 56 4d 61 | 78 20 2a 2f 0d 09 09 09 | . ,_VMa|x */....|
|00001490| 09 09 09 2f 2a 20 5f 64 | 56 3d 28 5f 56 4d 61 78 |.../* _d|V=(_VMax|
|000014a0| 2d 5f 56 4d 69 6e 29 2f | 28 4c 55 4d 49 4e 41 4e |-_VMin)/|(LUMINAN|
|000014b0| 43 45 53 5f 49 4e 5f 54 | 41 42 4c 45 2d 31 29 20 |CES_IN_T|ABLE-1) |
|000014c0| 2a 2f 0d 09 09 64 6f 75 | 62 6c 65 20 5f 4c 75 5b |*/...dou|ble _Lu[|
|000014d0| 4c 55 4d 49 4e 41 4e 43 | 45 53 5f 49 4e 5f 54 41 |LUMINANC|ES_IN_TA|
|000014e0| 42 4c 45 5d 3b 0d 09 23 | 65 6e 64 69 66 0d 7d 20 |BLE];..#|endif.} |
|000014f0| 4c 75 6d 69 6e 61 6e 63 | 65 54 61 62 6c 65 3b 0d |Luminanc|eTable;.|
|00001500| 0d 74 79 70 65 64 65 66 | 20 73 74 72 75 63 74 20 |.typedef| struct |
|00001510| 7b 09 2f 2a 20 22 74 61 | 62 6c 65 22 20 4d 55 53 |{./* "ta|ble" MUS|
|00001520| 54 20 62 65 20 74 68 65 | 20 66 69 72 73 74 20 74 |T be the| first t|
|00001530| 68 69 6e 67 20 69 6e 20 | 74 68 65 20 73 74 72 75 |hing in |the stru|
|00001540| 63 74 75 72 65 21 20 2a | 2f 0d 09 43 6f 6c 6f 72 |cture! *|/..Color|
|00001550| 53 70 65 63 20 74 61 62 | 6c 65 5b 43 4f 4c 4f 52 |Spec tab|le[COLOR|
|00001560| 53 5d 3b 2f 2a 20 61 20 | 74 61 62 6c 65 20 6f 66 |S];/* a |table of|
|00001570| 20 76 61 6c 75 65 73 20 | 64 65 73 74 69 6e 65 64 | values |destined|
|00001580| 20 66 6f 72 20 74 68 65 | 20 63 6c 75 74 20 2a 2f | for the| clut */|
|00001590| 0d 09 73 68 6f 72 74 20 | 64 61 63 53 69 7a 65 3b |..short |dacSize;|
|000015a0| 09 09 2f 2a 20 62 69 74 | 73 20 2a 2f 0d 09 73 68 |../* bit|s */..sh|
|000015b0| 6f 72 74 20 6c 65 66 74 | 53 68 69 66 74 3b 09 2f |ort left|Shift;./|
|000015c0| 2a 20 62 69 74 20 73 68 | 69 66 74 20 6f 66 20 56 |* bit sh|ift of V|
|000015d0| 20 74 6f 20 70 72 6f 64 | 75 63 65 20 31 36 20 62 | to prod|uce 16 b|
|000015e0| 69 74 20 76 61 6c 75 65 | 3d 31 36 2d 64 61 63 53 |it value|=16-dacS|
|000015f0| 69 7a 65 20 2a 2f 0d 09 | 73 68 6f 72 74 20 56 4d |ize */..|short VM|
|00001600| 69 6e 2c 56 4d 61 78 3b | 09 2f 2a 20 6c 6f 77 65 |in,VMax;|./* lowe|
|00001610| 73 74 20 61 6e 64 20 68 | 69 67 68 65 73 74 20 44 |st and h|ighest D|
|00001620| 41 43 20 76 61 6c 75 65 | 73 20 61 6c 6c 6f 77 65 |AC value|s allowe|
|00001630| 64 3a 20 30 20 61 6e 64 | 20 32 35 35 20 2a 2f 0d |d: 0 and| 255 */.|
|00001640| 09 64 6f 75 62 6c 65 20 | 4c 4d 69 6e 2c 4c 4d 61 |.double |LMin,LMa|
|00001650| 78 3b 09 2f 2a 20 6c 75 | 6d 69 6e 61 6e 63 65 73 |x;./* lu|minances|
|00001660| 20 61 74 20 56 4d 69 6e | 20 26 20 56 4d 61 78 20 | at VMin| & VMax |
|00001670| 2a 2f 0d 09 64 6f 75 62 | 6c 65 20 4c 42 61 63 6b |*/..doub|le LBack|
|00001680| 67 72 6f 75 6e 64 3b 09 | 2f 2a 20 74 68 65 20 62 |ground;.|/* the b|
|00001690| 61 63 6b 67 72 6f 75 6e | 64 20 6c 75 6d 69 6e 61 |ackgroun|d lumina|
|000016a0| 6e 63 65 20 75 73 65 64 | 20 64 75 72 69 6e 67 20 |nce used| during |
|000016b0| 6c 75 6d 69 6e 61 6e 63 | 65 20 63 61 6c 69 62 72 |luminanc|e calibr|
|000016c0| 61 74 69 6f 6e 20 2a 2f | 0d 09 73 68 6f 72 74 20 |ation */|..short |
|000016d0| 56 42 61 63 6b 67 72 6f | 75 6e 64 3b 09 2f 2a 20 |VBackgro|und;./* |
|000016e0| 74 68 65 20 62 61 63 6b | 67 72 6f 75 6e 64 20 6e |the back|ground n|
|000016f0| 75 6d 62 65 72 20 75 73 | 65 64 20 64 75 72 69 6e |umber us|ed durin|
|00001700| 67 20 6c 75 6d 69 6e 61 | 6e 63 65 20 63 61 6c 69 |g lumina|nce cali|
|00001710| 62 72 61 74 69 6f 6e 20 | 2a 2f 0d 09 73 68 6f 72 |bration |*/..shor|
|00001720| 74 20 73 63 72 65 65 6e | 3b 09 09 2f 2a 20 64 65 |t screen|;../* de|
|00001730| 76 69 63 65 3d 47 65 74 | 53 63 72 65 65 6e 44 65 |vice=Get|ScreenDe|
|00001740| 76 69 63 65 28 4c 52 2e | 73 63 72 65 65 6e 29 3b |vice(LR.|screen);|
|00001750| 20 2a 2f 0d 09 63 68 61 | 72 20 2a 69 64 3b 09 09 | */..cha|r *id;..|
|00001760| 09 2f 2a 20 6d 61 6b 65 | 2c 20 6d 6f 64 65 6c 2c |./* make|, model,|
|00001770| 20 61 6e 64 20 73 65 72 | 69 61 6c 20 6e 75 6d 62 | and ser|ial numb|
|00001780| 65 72 20 6f 66 20 6d 6f | 6e 69 74 6f 72 20 2a 2f |er of mo|nitor */|
|00001790| 0d 09 63 68 61 72 20 2a | 6e 61 6d 65 3b 09 09 09 |..char *|name;...|
|000017a0| 2f 2a 20 69 6e 66 6f 72 | 6d 61 6c 20 6e 61 6d 65 |/* infor|mal name|
|000017b0| 20 6f 66 20 6d 6f 6e 69 | 74 6f 72 20 2a 2f 0d 09 | of moni|tor */..|
|000017c0| 63 68 61 72 20 2a 64 61 | 74 65 3b 09 09 09 2f 2a |char *da|te;.../*|
|000017d0| 20 77 68 65 6e 20 63 61 | 6c 69 62 72 61 74 65 64 | when ca|librated|
|000017e0| 20 2a 2f 0d 09 63 68 61 | 72 20 2a 6e 6f 74 65 73 | */..cha|r *notes|
|000017f0| 3b 09 09 2f 2a 20 64 65 | 73 63 72 69 70 74 69 6f |;../* de|scriptio|
|00001800| 6e 20 6f 66 20 63 61 6c | 69 62 20 63 6f 6e 64 69 |n of cal|ib condi|
|00001810| 74 69 6f 6e 73 3a 20 77 | 68 6f 20 26 20 68 6f 77 |tions: w|ho & how|
|00001820| 20 2a 2f 0d 09 64 6f 75 | 62 6c 65 20 64 70 69 3b | */..dou|ble dpi;|
|00001830| 09 09 09 2f 2a 20 70 69 | 78 65 6c 73 20 70 65 72 |.../* pi|xels per|
|00001840| 20 69 6e 63 68 20 2a 2f | 0d 09 64 6f 75 62 6c 65 | inch */|..double|
|00001850| 20 48 7a 3b 09 09 09 2f | 2a 20 66 72 61 6d 65 73 | Hz;.../|* frames|
|00001860| 20 70 65 72 20 73 65 63 | 6f 6e 64 20 2a 2f 0d 09 | per sec|ond */..|
|00001870| 63 68 61 72 20 2a 75 6e | 69 74 73 3b 09 09 2f 2a |char *un|its;../*|
|00001880| 20 4c 75 6d 69 6e 61 6e | 63 65 20 75 6e 69 74 73 | Luminan|ce units|
|00001890| 2c 20 65 2e 67 2e 20 22 | 63 64 2f 6d 5e 32 22 20 |, e.g. "|cd/m^2" |
|000018a0| 2a 2f 0d 09 6c 6f 6e 67 | 20 63 6f 65 66 66 69 63 |*/..long| coeffic|
|000018b0| 69 65 6e 74 73 3b 09 2f | 2a 20 74 68 65 20 6e 75 |ients;./|* the nu|
|000018c0| 6d 62 65 72 20 6f 66 20 | 63 6f 65 66 66 69 63 69 |mber of |coeffici|
|000018d0| 65 6e 74 73 2c 20 6e 6f | 74 20 6d 6f 72 65 20 74 |ents, no|t more t|
|000018e0| 68 61 6e 20 4d 41 58 5f | 43 4f 45 46 46 49 43 49 |han MAX_|COEFFICI|
|000018f0| 45 4e 54 53 2c 20 2a 2f | 0d 09 09 09 09 09 09 2f |ENTS, */|......./|
|00001900| 2a 09 75 73 75 61 6c 6c | 79 20 39 2c 20 67 69 76 |*.usuall|y 9, giv|
|00001910| 69 6e 67 20 61 6e 20 38 | 74 68 2d 6f 72 64 65 72 |ing an 8|th-order|
|00001920| 20 70 6f 6c 79 6e 6f 6d | 69 61 6c 2c 20 2a 2f 0d | polynom|ial, */.|
|00001930| 09 64 6f 75 62 6c 65 20 | 70 5b 4d 41 58 5f 43 4f |.double |p[MAX_CO|
|00001940| 45 46 46 49 43 49 45 4e | 54 53 5d 3b 0d 09 09 09 |EFFICIEN|TS];....|
|00001950| 09 09 09 2f 2a 20 63 6f | 65 66 66 69 63 69 65 6e |.../* co|efficien|
|00001960| 74 73 20 6f 66 20 61 20 | 70 6f 6c 79 6e 6f 6d 69 |ts of a |polynomi|
|00001970| 61 6c 20 69 6e 20 76 61 | 6c 75 65 20 56 2c 20 79 |al in va|lue V, y|
|00001980| 69 65 6c 64 69 6e 67 20 | 4c 20 69 6e 20 63 64 2f |ielding |L in cd/|
|00001990| 6d 5e 32 20 2a 2f 0d 09 | 64 6f 75 62 6c 65 20 70 |m^2 */..|double p|
|000019a0| 6f 6c 79 6e 6f 6d 69 61 | 6c 45 72 72 6f 72 3b 09 |olynomia|lError;.|
|000019b0| 2f 2a 20 52 4d 53 20 65 | 72 72 6f 72 20 6f 66 20 |/* RMS e|rror of |
|000019c0| 70 6f 6c 79 6e 6f 6d 69 | 61 6c 20 66 69 74 20 2a |polynomi|al fit *|
|000019d0| 2f 0d 09 09 09 09 09 09 | 2f 2a 20 4c 28 56 29 3d |/.......|/* L(V)=|
|000019e0| 70 5b 30 5d 2b 70 5b 31 | 5d 2a 56 2b 70 5b 32 5d |p[0]+p[1|]*V+p[2]|
|000019f0| 2a 56 2a 56 2b 20 2e 20 | 2e 20 2e 20 b1 70 6f 6c |*V*V+ . |. . .pol|
|00001a00| 79 6e 6f 6d 69 61 6c 45 | 72 72 6f 72 20 2a 2f 0d |ynomialE|rror */.|
|00001a10| 09 64 6f 75 62 6c 65 20 | 71 5b 33 5d 3b 09 09 2f |.double |q[3];../|
|00001a20| 2a 20 63 6f 65 66 66 69 | 63 69 65 6e 74 73 20 6f |* coeffi|cients o|
|00001a30| 66 20 61 20 71 75 61 64 | 72 61 74 69 63 20 70 6f |f a quad|ratic po|
|00001a40| 6c 79 6e 6f 6d 69 61 6c | 20 69 6e 20 56 20 2a 2f |lynomial| in V */|
|00001a50| 0d 09 64 6f 75 62 6c 65 | 20 71 75 61 64 72 61 74 |..double| quadrat|
|00001a60| 69 63 45 72 72 6f 72 3b | 09 2f 2a 20 52 4d 53 20 |icError;|./* RMS |
|00001a70| 65 72 72 6f 72 20 6f 66 | 20 71 75 61 64 72 61 74 |error of| quadrat|
|00001a80| 69 63 20 66 69 74 20 2a | 2f 0d 09 09 09 09 09 09 |ic fit *|/.......|
|00001a90| 2f 2a 20 4c 28 56 29 3d | 71 5b 30 5d 2b 71 5b 31 |/* L(V)=|q[0]+q[1|
|00001aa0| 5d 2a 56 2b 71 5b 32 5d | 2a 56 2a 56 b1 71 75 61 |]*V+q[2]|*V*V.qua|
|00001ab0| 64 72 61 74 69 63 45 72 | 72 6f 72 20 2a 2f 0d 09 |draticEr|ror */..|
|00001ac0| 64 6f 75 62 6c 65 20 70 | 6f 77 65 72 5b 34 5d 3b |double p|ower[4];|
|00001ad0| 09 2f 2a 20 63 6f 65 66 | 66 69 63 69 65 6e 74 73 |./* coef|ficients|
|00001ae0| 20 6f 66 20 61 20 70 6f | 77 65 72 20 6c 61 77 20 | of a po|wer law |
|00001af0| 66 69 74 20 2a 2f 0d 09 | 64 6f 75 62 6c 65 20 70 |fit */..|double p|
|00001b00| 6f 77 65 72 45 72 72 6f | 72 3b 09 2f 2a 20 52 4d |owerErro|r;./* RM|
|00001b10| 53 20 65 72 72 6f 72 20 | 6f 66 20 70 6f 77 65 72 |S error |of power|
|00001b20| 20 6c 61 77 20 66 69 74 | 20 2a 2f 0d 09 09 09 09 | law fit| */.....|
|00001b30| 09 09 2f 2a 20 4c 28 56 | 29 3d 70 6f 77 65 72 5b |../* L(V|)=power[|
|00001b40| 30 5d 2b 52 65 63 74 69 | 66 79 28 70 6f 77 65 72 |0]+Recti|fy(power|
|00001b50| 5b 31 5d 2b 70 6f 77 65 | 72 5b 32 5d 2a 56 29 5e |[1]+powe|r[2]*V)^|
|00001b60| 70 6f 77 65 72 5b 33 5d | b1 70 6f 77 65 72 45 72 |power[3]|.powerEr|
|00001b70| 72 6f 72 20 2a 2f 0d 09 | 09 09 09 09 09 2f 2a 20 |ror */..|...../* |
|00001b80| 52 65 63 74 69 66 79 28 | 78 29 3d 78 20 69 66 20 |Rectify(|x)=x if |
|00001b90| 78 b3 30 2c 20 52 65 63 | 74 69 66 79 28 78 29 3d |x.0, Rec|tify(x)=|
|00001ba0| 30 20 69 66 20 78 3c 30 | 20 2a 2f 0d 09 09 09 09 |0 if x<0| */.....|
|00001bb0| 09 09 2f 2a 20 50 65 6c | 6c 69 20 26 20 5a 68 61 |../* Pel|li & Zha|
|00001bc0| 6e 67 20 28 31 39 39 31 | 29 20 45 71 73 2e 39 26 |ng (1991|) Eqs.9&|
|00001bd0| 31 30 20 75 73 65 20 73 | 79 6d 62 6f 6c 73 3a 20 |10 use s|ymbols: |
|00001be0| 2a 2f 0d 09 09 09 09 09 | 09 2f 2a 20 76 3d 56 2f |*/......|./* v=V/|
|00001bf0| 32 35 35 2c 20 61 6c 70 | 68 61 3d 70 6f 77 65 72 |255, alp|ha=power|
|00001c00| 5b 30 5d 2c 20 62 65 74 | 61 3d 70 6f 77 65 72 5b |[0], bet|a=power[|
|00001c10| 31 5d 2c 20 6b 61 70 70 | 61 3d 70 6f 77 65 72 5b |1], kapp|a=power[|
|00001c20| 32 5d 2a 32 35 35 2c 20 | 2a 2f 0d 09 09 09 09 09 |2]*255, |*/......|
|00001c30| 09 2f 2a 20 67 61 6d 6d | 61 3d 70 6f 77 65 72 5b |./* gamm|a=power[|
|00001c40| 33 5d 20 2a 2f 0d 09 64 | 6f 75 62 6c 65 20 66 69 |3] */..d|ouble fi|
|00001c50| 78 65 64 50 6f 77 65 72 | 5b 34 5d 3b 09 2f 2a 20 |xedPower|[4];./* |
|00001c60| 63 6f 65 66 66 69 63 69 | 65 6e 74 73 20 6f 66 20 |coeffici|ents of |
|00001c70| 61 20 70 6f 77 65 72 20 | 6c 61 77 20 66 69 74 2c |a power |law fit,|
|00001c80| 20 77 69 74 68 20 66 69 | 78 65 64 20 65 78 70 6f | with fi|xed expo|
|00001c90| 6e 65 6e 74 20 2a 2f 0d | 09 64 6f 75 62 6c 65 20 |nent */.|.double |
|00001ca0| 66 69 78 65 64 50 6f 77 | 65 72 45 72 72 6f 72 3b |fixedPow|erError;|
|00001cb0| 09 2f 2a 20 52 4d 53 20 | 65 72 72 6f 72 20 6f 66 |./* RMS |error of|
|00001cc0| 20 70 6f 77 65 72 20 6c | 61 77 20 66 69 74 20 2a | power l|aw fit *|
|00001cd0| 2f 0d 09 09 09 09 09 09 | 2f 2a 20 4c 28 56 29 3d |/.......|/* L(V)=|
|00001ce0| 66 69 78 65 64 50 6f 77 | 65 72 5b 30 5d 2b 52 65 |fixedPow|er[0]+Re|
|00001cf0| 63 74 69 66 79 28 66 69 | 78 65 64 50 6f 77 65 72 |ctify(fi|xedPower|
|00001d00| 5b 31 5d 2b 66 69 78 65 | 64 50 6f 77 65 72 5b 32 |[1]+fixe|dPower[2|
|00001d10| 5d 2a 56 29 5e 66 69 78 | 65 64 50 6f 77 65 72 5b |]*V)^fix|edPower[|
|00001d20| 33 5d b1 66 69 78 65 64 | 50 6f 77 65 72 45 72 72 |3].fixed|PowerErr|
|00001d30| 6f 72 20 2a 2f 0d 09 64 | 6f 75 62 6c 65 20 72 2c |or */..d|ouble r,|
|00001d40| 67 2c 62 3b 09 09 2f 2a | 20 76 6f 6c 74 61 67 65 |g,b;../*| voltage|
|00001d50| 20 67 61 69 6e 73 20 66 | 6f 72 20 74 68 65 20 74 | gains f|or the t|
|00001d60| 68 72 65 65 20 70 61 74 | 68 77 61 79 73 2e 20 72 |hree pat|hways. r|
|00001d70| 2b 67 2b 62 3d 31 2e 20 | 41 6c 6c 20 6d 75 73 74 |+g+b=1. |All must|
|00001d80| 20 62 65 20 b3 30 2e 20 | 2a 2f 0d 09 64 6f 75 62 | be .0. |*/..doub|
|00001d90| 6c 65 20 67 61 69 6e 41 | 63 63 75 72 61 63 79 3b |le gainA|ccuracy;|
|00001da0| 2f 2a 20 70 6f 73 73 69 | 62 6c 65 20 65 72 72 6f |/* possi|ble erro|
|00001db0| 72 20 69 6e 20 72 2c 67 | 2c 62 20 2a 2f 0d 09 64 |r in r,g|,b */..d|
|00001dc0| 6f 75 62 6c 65 20 67 6d | 3b 09 09 09 2f 2a 20 54 |ouble gm|;.../* T|
|00001dd0| 68 65 20 6d 6f 6e 69 74 | 6f 72 27 73 20 63 6f 6e |he monit|or's con|
|00001de0| 74 72 61 73 74 20 67 61 | 69 6e 2e 20 54 68 65 20 |trast ga|in. The |
|00001df0| 4d 69 63 68 65 6c 73 6f | 6e 20 63 6f 6e 74 72 61 |Michelso|n contra|
|00001e00| 73 74 20 70 72 6f 64 75 | 63 65 64 20 62 79 0d 09 |st produ|ced by..|
|00001e10| 09 09 09 09 09 09 61 20 | 73 6d 61 6c 6c 20 c6 76 |......a |small .v|
|00001e20| 20 61 74 20 74 68 65 20 | 62 61 63 6b 67 72 6f 75 | at the |backgrou|
|00001e30| 6e 64 20 6c 75 6d 69 6e | 61 6e 63 65 20 69 73 20 |nd lumin|ance is |
|00001e40| 63 3d 67 6d 2a c6 76 20 | 2a 2f 0d 09 2f 2a 20 54 |c=gm*.v |*/../* T|
|00001e50| 68 65 20 72 65 73 74 20 | 6f 66 20 74 68 65 20 70 |he rest |of the p|
|00001e60| 61 72 61 6d 65 74 65 72 | 73 20 61 72 65 20 66 6f |arameter|s are fo|
|00001e70| 72 20 74 65 6d 70 6f 72 | 61 72 79 20 73 74 6f 72 |r tempor|ary stor|
|00001e80| 61 67 65 20 62 79 20 53 | 65 74 4c 75 6d 69 6e 61 |age by S|etLumina|
|00001e90| 6e 63 65 52 61 6e 67 65 | 28 29 20 2a 2f 0d 09 64 |nceRange|() */..d|
|00001ea0| 6f 75 62 6c 65 20 6c 6f | 77 4c 75 6d 69 6e 61 6e |ouble lo|wLuminan|
|00001eb0| 63 65 3b 09 2f 2a 20 74 | 68 65 20 62 6f 74 74 6f |ce;./* t|he botto|
|00001ec0| 6d 20 6f 66 20 74 68 65 | 20 72 61 6e 67 65 20 2a |m of the| range *|
|00001ed0| 2f 0d 09 64 6f 75 62 6c | 65 20 68 69 67 68 4c 75 |/..doubl|e highLu|
|00001ee0| 6d 69 6e 61 6e 63 65 3b | 09 2f 2a 20 74 68 65 20 |minance;|./* the |
|00001ef0| 74 6f 70 20 6f 66 20 74 | 68 65 20 72 61 6e 67 65 |top of t|he range|
|00001f00| 20 2a 2f 0d 09 73 68 6f | 72 74 20 72 61 6e 67 65 | */..sho|rt range|
|00001f10| 53 65 74 3b 09 09 09 2f | 2a 20 61 20 63 68 65 63 |Set;.../|* a chec|
|00001f20| 6b 20 74 68 61 74 20 74 | 68 65 20 72 61 6e 67 65 |k that t|he range|
|00001f30| 20 72 65 61 6c 6c 79 20 | 68 61 73 20 62 65 65 6e | really |has been|
|00001f40| 20 73 65 74 20 2a 2f 0d | 09 73 68 6f 72 74 20 64 | set */.|.short d|
|00001f50| 61 63 73 3b 09 09 09 09 | 2f 2a 20 74 68 65 20 6e |acs;....|/* the n|
|00001f60| 75 6d 62 65 72 20 6f 66 | 20 64 61 63 73 20 77 69 |umber of| dacs wi|
|00001f70| 74 68 20 6e 6f 6e 7a 65 | 72 6f 20 67 61 69 6e 2c |th nonze|ro gain,|
|00001f80| 20 75 73 75 61 6c 6c 79 | 20 31 20 6f 72 20 33 20 | usually| 1 or 3 |
|00001f90| 2a 2f 0d 09 73 68 6f 72 | 74 20 66 69 78 65 64 3b |*/..shor|t fixed;|
|00001fa0| 09 09 09 2f 2a 20 74 68 | 65 20 6e 75 6d 62 65 72 |.../* th|e number|
|00001fb0| 20 6f 66 20 64 61 63 73 | 20 77 68 6f 73 65 20 76 | of dacs| whose v|
|00001fc0| 61 6c 75 65 20 77 69 6c | 6c 20 62 65 20 66 69 78 |alue wil|l be fix|
|00001fd0| 65 64 20 66 6f 72 20 74 | 68 69 73 20 72 61 6e 67 |ed for t|his rang|
|00001fe0| 65 20 2a 2f 0d 09 73 68 | 6f 72 74 20 64 61 63 5b |e */..sh|ort dac[|
|00001ff0| 44 41 43 53 5d 3b 09 09 | 2f 2a 20 77 68 69 63 68 |DACS];..|/* which|
|00002000| 20 64 61 63 20 63 6f 72 | 72 65 73 70 6f 6e 64 73 | dac cor|responds|
|00002010| 20 74 6f 20 65 61 63 68 | 20 67 61 69 6e 2c 20 72 | to each| gain, r|
|00002020| 3d 30 2c 67 3d 31 2c 62 | 3d 32 20 2a 2f 0d 09 64 |=0,g=1,b|=2 */..d|
|00002030| 6f 75 62 6c 65 20 67 61 | 69 6e 5b 44 41 43 53 5d |ouble ga|in[DACS]|
|00002040| 3b 09 09 2f 2a 20 74 68 | 65 20 6f 72 64 65 72 65 |;../* th|e ordere|
|00002050| 64 20 6e 6f 72 6d 61 6c | 69 7a 65 64 20 67 61 69 |d normal|ized gai|
|00002060| 6e 73 20 6f 66 20 74 68 | 65 20 56 69 64 65 6f 20 |ns of th|e Video |
|00002070| 41 74 74 65 6e 75 61 74 | 6f 72 20 2a 2f 0d 09 64 |Attenuat|or */..d|
|00002080| 6f 75 62 6c 65 20 56 48 | 61 6c 66 53 74 65 70 3b |ouble VH|alfStep;|
|00002090| 09 09 2f 2a 20 68 61 6c | 66 20 61 20 73 74 65 70 |../* hal|f a step|
|000020a0| 20 6f 66 20 74 68 65 20 | 66 69 6e 65 73 74 20 64 | of the |finest d|
|000020b0| 61 63 20 2a 2f 0d 09 64 | 6f 75 62 6c 65 20 56 46 |ac */..d|ouble VF|
|000020c0| 69 78 65 64 3b 09 09 09 | 2f 2a 20 74 68 65 20 76 |ixed;...|/* the v|
|000020d0| 61 6c 75 65 20 70 72 6f | 64 75 63 65 64 20 62 79 |alue pro|duced by|
|000020e0| 20 74 68 65 20 66 69 78 | 65 64 20 64 61 63 73 20 | the fix|ed dacs |
|000020f0| 2a 2f 0d 09 64 6f 75 62 | 6c 65 20 4c 4f 66 66 73 |*/..doub|le LOffs|
|00002100| 65 74 3b 09 09 09 2f 2a | 20 61 20 73 6d 61 6c 6c |et;.../*| a small|
|00002110| 20 73 68 69 66 74 20 6f | 66 20 74 68 65 20 72 65 | shift o|f the re|
|00002120| 71 75 65 73 74 65 64 20 | 6c 75 6d 69 6e 61 6e 63 |quested |luminanc|
|00002130| 65 20 72 61 6e 67 65 20 | 2a 2f 0d 09 64 6f 75 62 |e range |*/..doub|
|00002140| 6c 65 20 74 6f 6c 65 72 | 61 6e 63 65 3b 09 09 2f |le toler|ance;../|
|00002150| 2a 20 74 68 65 20 6c 75 | 6d 69 6e 61 6e 63 65 20 |* the lu|minance |
|00002160| 65 72 72 6f 72 20 63 6f | 72 72 65 73 70 6f 6e 64 |error co|rrespond|
|00002170| 69 6e 67 20 74 6f 20 68 | 61 6c 66 20 0d 09 09 09 |ing to h|alf ....|
|00002180| 09 09 09 09 09 61 20 73 | 74 65 70 20 6f 66 20 74 |.....a s|tep of t|
|00002190| 68 65 20 63 6f 61 72 73 | 65 73 74 20 6f 66 20 74 |he coars|est of t|
|000021a0| 68 65 20 76 61 72 69 61 | 62 6c 65 20 64 61 63 73 |he varia|ble dacs|
|000021b0| 20 2a 2f 0d 09 23 69 66 | 20 46 41 53 54 5f 4c 55 | */..#if| FAST_LU|
|000021c0| 4d 49 4e 41 4e 43 45 0d | 09 09 46 69 78 65 64 20 |MINANCE.|..Fixed |
|000021d0| 5f 67 61 69 6e 5b 44 41 | 43 53 5d 3b 0d 09 09 46 |_gain[DA|CS];...F|
|000021e0| 69 78 65 64 20 5f 56 48 | 61 6c 66 53 74 65 70 3b |ixed _VH|alfStep;|
|000021f0| 0d 09 09 46 69 78 65 64 | 20 5f 56 46 69 78 65 64 |...Fixed| _VFixed|
|00002200| 3b 0d 09 09 46 69 78 65 | 64 20 5f 4c 4f 66 66 73 |;...Fixe|d _LOffs|
|00002210| 65 74 3b 0d 09 09 46 69 | 78 65 64 20 5f 74 6f 6c |et;...Fi|xed _tol|
|00002220| 65 72 61 6e 63 65 3b 0d | 09 23 65 6c 73 65 0d 09 |erance;.|.#else..|
|00002230| 09 64 6f 75 62 6c 65 20 | 5f 67 61 69 6e 5b 44 41 |.double |_gain[DA|
|00002240| 43 53 5d 3b 0d 09 09 64 | 6f 75 62 6c 65 20 5f 56 |CS];...d|ouble _V|
|00002250| 48 61 6c 66 53 74 65 70 | 3b 0d 09 09 64 6f 75 62 |HalfStep|;...doub|
|00002260| 6c 65 20 5f 56 46 69 78 | 65 64 3b 0d 09 09 64 6f |le _VFix|ed;...do|
|00002270| 75 62 6c 65 20 5f 4c 4f | 66 66 73 65 74 3b 0d 09 |uble _LO|ffset;..|
|00002280| 09 64 6f 75 62 6c 65 20 | 5f 74 6f 6c 65 72 61 6e |.double |_toleran|
|00002290| 63 65 3b 0d 09 23 65 6e | 64 69 66 0d 09 52 47 42 |ce;..#en|dif..RGB|
|000022a0| 43 6f 6c 6f 72 20 72 67 | 62 3b 09 09 09 2f 2a 20 |Color rg|b;.../* |
|000022b0| 63 61 63 68 65 20 74 68 | 65 20 76 61 6c 75 65 73 |cache th|e values|
|000022c0| 20 6f 66 20 74 68 65 20 | 66 69 78 65 64 20 44 41 | of the |fixed DA|
|000022d0| 43 73 20 2a 2f 0d 09 4c | 75 6d 69 6e 61 6e 63 65 |Cs */..L|uminance|
|000022e0| 54 61 62 6c 65 20 4c 3b | 0d 7d 20 4c 75 6d 69 6e |Table L;|.} Lumin|
|000022f0| 61 6e 63 65 52 65 63 6f | 72 64 3b 0d 0d 74 79 70 |anceReco|rd;..typ|
|00002300| 65 64 65 66 20 4c 75 6d | 69 6e 61 6e 63 65 54 61 |edef Lum|inanceTa|
|00002310| 62 6c 65 20 6c 75 6d 69 | 6e 61 6e 63 65 54 61 62 |ble lumi|nanceTab|
|00002320| 6c 65 3b 09 2f 2f 20 75 | 6e 63 61 70 69 74 61 6c |le;.// u|ncapital|
|00002330| 69 7a 65 64 20 75 6e 74 | 69 6c 20 4d 61 79 2c 20 |ized unt|il May, |
|00002340| 31 39 39 35 0d 74 79 70 | 65 64 65 66 20 4c 75 6d |1995.typ|edef Lum|
|00002350| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 20 6c 75 6d |inanceRe|cord lum|
|00002360| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 3b 2f 2f 20 |inanceRe|cord;// |
|00002370| 75 6e 63 61 70 69 74 61 | 6c 69 7a 65 64 20 75 6e |uncapita|lized un|
|00002380| 74 69 6c 20 4f 63 74 6f | 62 65 72 20 31 39 39 34 |til Octo|ber 1994|
|00002390| 2e 0d 0d 65 6e 75 6d 20 | 7b 6c 75 6d 69 6e 61 6e |...enum |{luminan|
|000023a0| 63 65 53 65 74 3d 31 32 | 33 34 35 7d 3b 09 2f 2a |ceSet=12|345};./*|
|000023b0| 20 61 20 75 6e 69 71 75 | 65 20 76 61 6c 75 65 20 | a uniqu|e value |
|000023c0| 74 68 61 74 20 77 65 20 | 63 61 6e 20 63 68 65 63 |that we |can chec|
|000023d0| 6b 20 66 6f 72 20 6c 61 | 74 65 72 20 2a 2f 0d 0d |k for la|ter */..|
|000023e0| 2f 2a 20 4c 75 6d 69 6e | 61 6e 63 65 2e 63 20 2a |/* Lumin|ance.c *|
|000023f0| 2f 0d 64 6f 75 62 6c 65 | 20 45 54 6f 4c 28 4c 75 |/.double| EToL(Lu|
|00002400| 6d 69 6e 61 6e 63 65 52 | 65 63 6f 72 64 20 2a 4c |minanceR|ecord *L|
|00002410| 50 2c 69 6e 74 20 65 6e | 74 72 79 29 3b 0d 69 6e |P,int en|try);.in|
|00002420| 74 20 4c 54 6f 45 28 4c | 75 6d 69 6e 61 6e 63 65 |t LToE(L|uminance|
|00002430| 52 65 63 6f 72 64 20 2a | 4c 50 2c 64 6f 75 62 6c |Record *|LP,doubl|
|00002440| 65 20 4c 2c 69 6e 74 20 | 66 69 72 73 74 45 6e 74 |e L,int |firstEnt|
|00002450| 72 79 2c 69 6e 74 20 6c | 61 73 74 45 6e 74 72 79 |ry,int l|astEntry|
|00002460| 29 3b 0d 69 6e 74 20 4c | 54 6f 45 4f 72 64 65 72 |);.int L|ToEOrder|
|00002470| 65 64 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ed(Lumin|anceReco|
|00002480| 72 64 20 2a 4c 50 2c 64 | 6f 75 62 6c 65 20 4c 2c |rd *LP,d|ouble L,|
|00002490| 69 6e 74 20 66 69 72 73 | 74 45 6e 74 72 79 2c 69 |int firs|tEntry,i|
|000024a0| 6e 74 20 6c 61 73 74 45 | 6e 74 72 79 29 3b 0d 64 |nt lastE|ntry);.d|
|000024b0| 6f 75 62 6c 65 20 53 65 | 74 4c 75 6d 69 6e 61 6e |ouble Se|tLuminan|
|000024c0| 63 65 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |ce(GDHan|dle devi|
|000024d0| 63 65 2c 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ce,Lumin|anceReco|
|000024e0| 72 64 20 2a 4c 50 0d 09 | 2c 69 6e 74 20 74 68 65 |rd *LP..|,int the|
|000024f0| 45 6e 74 72 79 2c 64 6f | 75 62 6c 65 20 6c 75 6d |Entry,do|uble lum|
|00002500| 69 6e 61 6e 63 65 0d 09 | 2c 64 6f 75 62 6c 65 20 |inance..|,double |
|00002510| 6c 6f 77 4c 75 6d 69 6e | 61 6e 63 65 2c 64 6f 75 |lowLumin|ance,dou|
|00002520| 62 6c 65 20 68 69 67 68 | 4c 75 6d 69 6e 61 6e 63 |ble high|Luminanc|
|00002530| 65 29 3b 0d 64 6f 75 62 | 6c 65 20 53 65 74 4c 75 |e);.doub|le SetLu|
|00002540| 6d 69 6e 61 6e 63 65 73 | 28 47 44 48 61 6e 64 6c |minances|(GDHandl|
|00002550| 65 20 64 65 76 69 63 65 | 2c 4c 75 6d 69 6e 61 6e |e device|,Luminan|
|00002560| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 0d 09 2c 69 |ceRecord| *LP..,i|
|00002570| 6e 74 20 66 69 72 73 74 | 45 6e 74 72 79 2c 69 6e |nt first|Entry,in|
|00002580| 74 20 6c 61 73 74 45 6e | 74 72 79 0d 09 2c 64 6f |t lastEn|try..,do|
|00002590| 75 62 6c 65 20 66 69 72 | 73 74 4c 75 6d 69 6e 61 |uble fir|stLumina|
|000025a0| 6e 63 65 2c 64 6f 75 62 | 6c 65 20 6c 61 73 74 4c |nce,doub|le lastL|
|000025b0| 75 6d 69 6e 61 6e 63 65 | 29 3b 0d 64 6f 75 62 6c |uminance|);.doubl|
|000025c0| 65 20 53 65 74 4c 75 6d | 69 6e 61 6e 63 65 73 41 |e SetLum|inancesA|
|000025d0| 6e 64 52 61 6e 67 65 28 | 47 44 48 61 6e 64 6c 65 |ndRange(|GDHandle|
|000025e0| 20 64 65 76 69 63 65 2c | 4c 75 6d 69 6e 61 6e 63 | device,|Luminanc|
|000025f0| 65 52 65 63 6f 72 64 20 | 2a 4c 50 0d 09 2c 69 6e |eRecord |*LP..,in|
|00002600| 74 20 66 69 72 73 74 45 | 6e 74 72 79 2c 69 6e 74 |t firstE|ntry,int|
|00002610| 20 6c 61 73 74 45 6e 74 | 72 79 0d 09 2c 64 6f 75 | lastEnt|ry..,dou|
|00002620| 62 6c 65 20 66 69 72 73 | 74 4c 75 6d 69 6e 61 6e |ble firs|tLuminan|
|00002630| 63 65 2c 64 6f 75 62 6c | 65 20 6c 61 73 74 4c 75 |ce,doubl|e lastLu|
|00002640| 6d 69 6e 61 6e 63 65 0d | 09 2c 64 6f 75 62 6c 65 |minance.|.,double|
|00002650| 20 6c 6f 77 4c 75 6d 69 | 6e 61 6e 63 65 2c 64 6f | lowLumi|nance,do|
|00002660| 75 62 6c 65 20 68 69 67 | 68 4c 75 6d 69 6e 61 6e |uble hig|hLuminan|
|00002670| 63 65 29 3b 0d 76 6f 69 | 64 20 4c 6f 61 64 4c 75 |ce);.voi|d LoadLu|
|00002680| 6d 69 6e 61 6e 63 65 73 | 28 47 44 48 61 6e 64 6c |minances|(GDHandl|
|00002690| 65 20 64 65 76 69 63 65 | 2c 20 4c 75 6d 69 6e 61 |e device|, Lumina|
|000026a0| 6e 63 65 52 65 63 6f 72 | 64 20 2a 4c 50 2c 0d 09 |nceRecor|d *LP,..|
|000026b0| 69 6e 74 20 66 69 72 73 | 74 45 6e 74 72 79 2c 20 |int firs|tEntry, |
|000026c0| 69 6e 74 20 6c 61 73 74 | 45 6e 74 72 79 29 3b 0d |int last|Entry);.|
|000026d0| 76 6f 69 64 20 49 6e 63 | 72 65 6d 65 6e 74 4c 75 |void Inc|rementLu|
|000026e0| 6d 69 6e 61 6e 63 65 28 | 47 44 48 61 6e 64 6c 65 |minance(|GDHandle|
|000026f0| 20 64 65 76 69 63 65 2c | 4c 75 6d 69 6e 61 6e 63 | device,|Luminanc|
|00002700| 65 52 65 63 6f 72 64 20 | 2a 4c 50 2c 69 6e 74 20 |eRecord |*LP,int |
|00002710| 74 68 65 45 6e 74 72 79 | 29 3b 0d 64 6f 75 62 6c |theEntry|);.doubl|
|00002720| 65 20 47 65 74 4c 75 6d | 69 6e 61 6e 63 65 28 47 |e GetLum|inance(G|
|00002730| 44 48 61 6e 64 6c 65 20 | 64 65 76 69 63 65 2c 4c |DHandle |device,L|
|00002740| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00002750| 4c 50 2c 69 6e 74 20 74 | 68 65 45 6e 74 72 79 29 |LP,int t|heEntry)|
|00002760| 3b 0d 64 6f 75 62 6c 65 | 20 47 65 74 56 28 47 44 |;.double| GetV(GD|
|00002770| 48 61 6e 64 6c 65 20 64 | 65 76 69 63 65 2c 4c 75 |Handle d|evice,Lu|
|00002780| 6d 69 6e 61 6e 63 65 52 | 65 63 6f 72 64 20 2a 4c |minanceR|ecord *L|
|00002790| 50 2c 69 6e 74 20 74 68 | 65 45 6e 74 72 79 29 3b |P,int th|eEntry);|
|000027a0| 0d 64 6f 75 62 6c 65 20 | 56 54 6f 4c 28 4c 75 6d |.double |VToL(Lum|
|000027b0| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 20 2a 4c 50 |inanceRe|cord *LP|
|000027c0| 2c 64 6f 75 62 6c 65 20 | 56 29 3b 0d 64 6f 75 62 |,double |V);.doub|
|000027d0| 6c 65 20 4c 54 6f 56 28 | 4c 75 6d 69 6e 61 6e 63 |le LToV(|Luminanc|
|000027e0| 65 52 65 63 6f 72 64 20 | 2a 4c 50 2c 64 6f 75 62 |eRecord |*LP,doub|
|000027f0| 6c 65 20 4c 29 3b 0d 64 | 6f 75 62 6c 65 20 4c 54 |le L);.d|ouble LT|
|00002800| 6f 56 46 6f 72 6d 75 6c | 61 69 63 28 4c 75 6d 69 |oVFormul|aic(Lumi|
|00002810| 6e 61 6e 63 65 52 65 63 | 6f 72 64 20 2a 4c 50 2c |nanceRec|ord *LP,|
|00002820| 64 6f 75 62 6c 65 20 4c | 29 3b 0d 64 6f 75 62 6c |double L|);.doubl|
|00002830| 65 20 4c 54 6f 4c 28 4c | 75 6d 69 6e 61 6e 63 65 |e LToL(L|uminance|
|00002840| 52 65 63 6f 72 64 20 2a | 4c 50 2c 64 6f 75 62 6c |Record *|LP,doubl|
|00002850| 65 20 4c 29 3b 0d 0d 2f | 2a 20 54 68 65 20 66 6f |e L);../|* The fo|
|00002860| 6c 6c 6f 77 69 6e 67 20 | 72 6f 75 74 69 6e 65 73 |llowing |routines|
|00002870| 20 61 72 65 20 70 72 69 | 6d 61 72 69 6c 79 20 66 | are pri|marily f|
|00002880| 6f 72 20 69 6e 74 65 72 | 6e 61 6c 20 75 73 65 2e |or inter|nal use.|
|00002890| 20 2a 2f 0d 23 69 66 20 | 46 41 53 54 5f 4c 55 4d | */.#if |FAST_LUM|
|000028a0| 49 4e 41 4e 43 45 0d 09 | 76 6f 69 64 20 5f 53 65 |INANCE..|void _Se|
|000028b0| 74 4c 75 6d 69 6e 61 6e | 63 65 28 4c 75 6d 69 6e |tLuminan|ce(Lumin|
|000028c0| 61 6e 63 65 52 65 63 6f | 72 64 20 2a 4c 50 74 72 |anceReco|rd *LPtr|
|000028d0| 2c 69 6e 74 20 74 68 65 | 45 6e 74 72 79 2c 46 69 |,int the|Entry,Fi|
|000028e0| 78 65 64 20 5f 6c 75 6d | 69 6e 61 6e 63 65 29 3b |xed _lum|inance);|
|000028f0| 0d 09 46 69 78 65 64 20 | 5f 54 6f 6c 65 72 61 6e |..Fixed |_Toleran|
|00002900| 63 65 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ce(Lumin|anceReco|
|00002910| 72 64 20 2a 4c 50 2c 46 | 69 78 65 64 20 5f 6c 75 |rd *LP,F|ixed _lu|
|00002920| 6d 69 6e 61 6e 63 65 29 | 3b 0d 09 76 6f 69 64 20 |minance)|;..void |
|00002930| 5f 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 73 28 4c |_SetLumi|nances(L|
|00002940| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00002950| 4c 50 2c 69 6e 74 20 66 | 69 72 73 74 2c 69 6e 74 |LP,int f|irst,int|
|00002960| 20 6c 61 73 74 0d 09 09 | 2c 46 69 78 65 64 20 5f | last...|,Fixed _|
|00002970| 66 69 72 73 74 4c 2c 46 | 69 78 65 64 20 5f 64 4c |firstL,F|ixed _dL|
|00002980| 36 34 2c 46 69 78 65 64 | 20 5f 66 69 72 73 74 56 |64,Fixed| _firstV|
|00002990| 2c 46 69 78 65 64 20 5f | 6c 61 73 74 56 29 3b 0d |,Fixed _|lastV);.|
|000029a0| 09 46 69 78 65 64 20 5f | 56 54 6f 4c 28 4c 75 6d |.Fixed _|VToL(Lum|
|000029b0| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 20 2a 4c 50 |inanceRe|cord *LP|
|000029c0| 2c 46 69 78 65 64 20 5f | 56 29 3b 0d 09 46 69 78 |,Fixed _|V);..Fix|
|000029d0| 65 64 20 5f 4c 54 6f 56 | 28 4c 75 6d 69 6e 61 6e |ed _LToV|(Luminan|
|000029e0| 63 65 52 65 63 6f 72 64 | 20 2a 4c 50 2c 46 69 78 |ceRecord| *LP,Fix|
|000029f0| 65 64 20 5f 4c 75 29 3b | 0d 23 65 6c 73 65 0d 09 |ed _Lu);|.#else..|
|00002a00| 76 6f 69 64 20 5f 53 65 | 74 4c 75 6d 69 6e 61 6e |void _Se|tLuminan|
|00002a10| 63 65 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ce(Lumin|anceReco|
|00002a20| 72 64 20 2a 4c 50 74 72 | 2c 69 6e 74 20 74 68 65 |rd *LPtr|,int the|
|00002a30| 45 6e 74 72 79 2c 64 6f | 75 62 6c 65 20 5f 6c 75 |Entry,do|uble _lu|
|00002a40| 6d 69 6e 61 6e 63 65 29 | 3b 0d 09 64 6f 75 62 6c |minance)|;..doubl|
|00002a50| 65 20 5f 54 6f 6c 65 72 | 61 6e 63 65 28 4c 75 6d |e _Toler|ance(Lum|
|00002a60| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 20 2a 4c 50 |inanceRe|cord *LP|
|00002a70| 2c 64 6f 75 62 6c 65 20 | 5f 6c 75 6d 69 6e 61 6e |,double |_luminan|
|00002a80| 63 65 29 3b 0d 09 76 6f | 69 64 20 5f 53 65 74 4c |ce);..vo|id _SetL|
|00002a90| 75 6d 69 6e 61 6e 63 65 | 73 28 4c 75 6d 69 6e 61 |uminance|s(Lumina|
|00002aa0| 6e 63 65 52 65 63 6f 72 | 64 20 2a 4c 50 2c 69 6e |nceRecor|d *LP,in|
|00002ab0| 74 20 66 69 72 73 74 2c | 69 6e 74 20 6c 61 73 74 |t first,|int last|
|00002ac0| 0d 09 09 2c 64 6f 75 62 | 6c 65 20 5f 66 69 72 73 |...,doub|le _firs|
|00002ad0| 74 4c 2c 64 6f 75 62 6c | 65 20 5f 64 4c 38 2c 64 |tL,doubl|e _dL8,d|
|00002ae0| 6f 75 62 6c 65 20 5f 66 | 69 72 73 74 56 2c 64 6f |ouble _f|irstV,do|
|00002af0| 75 62 6c 65 20 5f 6c 61 | 73 74 56 29 3b 0d 09 64 |uble _la|stV);..d|
|00002b00| 6f 75 62 6c 65 20 5f 56 | 54 6f 4c 28 4c 75 6d 69 |ouble _V|ToL(Lumi|
|00002b10| 6e 61 6e 63 65 52 65 63 | 6f 72 64 20 2a 4c 50 2c |nanceRec|ord *LP,|
|00002b20| 64 6f 75 62 6c 65 20 5f | 56 29 3b 0d 09 64 6f 75 |double _|V);..dou|
|00002b30| 62 6c 65 20 5f 4c 54 6f | 56 28 4c 75 6d 69 6e 61 |ble _LTo|V(Lumina|
|00002b40| 6e 63 65 52 65 63 6f 72 | 64 20 2a 4c 50 2c 64 6f |nceRecor|d *LP,do|
|00002b50| 75 62 6c 65 20 5f 4c 75 | 29 3b 0d 23 65 6e 64 69 |uble _Lu|);.#endi|
|00002b60| 66 0d 64 6f 75 62 6c 65 | 20 53 65 74 4c 75 6d 69 |f.double| SetLumi|
|00002b70| 6e 61 6e 63 65 52 61 6e | 67 65 28 4c 75 6d 69 6e |nanceRan|ge(Lumin|
|00002b80| 61 6e 63 65 52 65 63 6f | 72 64 20 2a 4c 50 0d 09 |anceReco|rd *LP..|
|00002b90| 2c 64 6f 75 62 6c 65 20 | 6c 6f 77 4c 75 6d 69 6e |,double |lowLumin|
|00002ba0| 61 6e 63 65 2c 64 6f 75 | 62 6c 65 20 68 69 67 68 |ance,dou|ble high|
|00002bb0| 4c 75 6d 69 6e 61 6e 63 | 65 29 3b 0d 64 6f 75 62 |Luminanc|e);.doub|
|00002bc0| 6c 65 20 56 54 6f 4c 50 | 6f 77 65 72 28 4c 75 6d |le VToLP|ower(Lum|
|00002bd0| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 20 2a 4c 50 |inanceRe|cord *LP|
|00002be0| 2c 64 6f 75 62 6c 65 20 | 56 29 3b 09 09 09 2f 2a |,double |V);.../*|
|00002bf0| 20 75 73 65 20 56 54 6f | 4c 28 29 20 69 6e 73 74 | use VTo|L() inst|
|00002c00| 65 61 64 20 2a 2f 0d 64 | 6f 75 62 6c 65 20 56 54 |ead */.d|ouble VT|
|00002c10| 6f 4c 50 6f 6c 79 6e 6f | 6d 69 61 6c 28 4c 75 6d |oLPolyno|mial(Lum|
|00002c20| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 20 2a 4c 50 |inanceRe|cord *LP|
|00002c30| 2c 64 6f 75 62 6c 65 20 | 56 29 3b 09 2f 2a 20 75 |,double |V);./* u|
|00002c40| 73 65 20 56 54 6f 4c 28 | 29 20 69 6e 73 74 65 61 |se VToL(|) instea|
|00002c50| 64 20 2a 2f 0d 64 6f 75 | 62 6c 65 20 4c 54 6f 56 |d */.dou|ble LToV|
|00002c60| 50 6f 77 65 72 28 4c 75 | 6d 69 6e 61 6e 63 65 52 |Power(Lu|minanceR|
|00002c70| 65 63 6f 72 64 20 2a 4c | 50 2c 64 6f 75 62 6c 65 |ecord *L|P,double|
|00002c80| 20 4c 29 3b 09 09 09 2f | 2a 20 75 73 65 20 4c 54 | L);.../|* use LT|
|00002c90| 6f 56 28 29 20 69 6e 73 | 74 65 61 64 20 2a 2f 0d |oV() ins|tead */.|
|00002ca0| 64 6f 75 62 6c 65 20 4c | 54 6f 56 50 6f 6c 79 6e |double L|ToVPolyn|
|00002cb0| 6f 6d 69 61 6c 28 4c 75 | 6d 69 6e 61 6e 63 65 52 |omial(Lu|minanceR|
|00002cc0| 65 63 6f 72 64 20 2a 4c | 50 2c 64 6f 75 62 6c 65 |ecord *L|P,double|
|00002cd0| 20 4c 29 3b 09 2f 2a 20 | 75 73 65 20 4c 54 6f 56 | L);./* |use LToV|
|00002ce0| 28 29 20 69 6e 73 74 65 | 61 64 20 2a 2f 0d 64 6f |() inste|ad */.do|
|00002cf0| 75 62 6c 65 20 4c 54 6f | 56 51 75 61 64 72 61 74 |uble LTo|VQuadrat|
|00002d00| 69 63 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ic(Lumin|anceReco|
|00002d10| 72 64 20 2a 4c 50 2c 64 | 6f 75 62 6c 65 20 4c 29 |rd *LP,d|ouble L)|
|00002d20| 3b 09 09 2f 2a 20 75 73 | 65 20 4c 54 6f 56 28 29 |;../* us|e LToV()|
|00002d30| 20 69 6e 73 74 65 61 64 | 20 2a 2f 0d 0d 2f 2a 20 | instead| */../* |
|00002d40| 52 65 61 64 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ReadLumi|nanceRec|
|00002d50| 6f 72 64 2e 63 20 2a 2f | 0d 0d 6c 6f 6e 67 20 52 |ord.c */|..long R|
|00002d60| 65 61 64 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |eadLumin|anceReco|
|00002d70| 72 64 28 63 68 61 72 20 | 2a 66 69 6c 65 6e 61 6d |rd(char |*filenam|
|00002d80| 65 2c 4c 75 6d 69 6e 61 | 6e 63 65 52 65 63 6f 72 |e,Lumina|nceRecor|
|00002d90| 64 20 2a 4c 50 2c 73 68 | 6f 72 74 20 66 6c 61 67 |d *LP,sh|ort flag|
|00002da0| 73 29 3b 0d 6c 6f 6e 67 | 20 57 72 69 74 65 4c 75 |s);.long| WriteLu|
|00002db0| 6d 69 6e 61 6e 63 65 52 | 65 63 6f 72 64 28 63 68 |minanceR|ecord(ch|
|00002dc0| 61 72 20 2a 66 69 6c 65 | 6e 61 6d 65 2c 4c 75 6d |ar *file|name,Lum|
|00002dd0| 69 6e 61 6e 63 65 52 65 | 63 6f 72 64 20 2a 4c 50 |inanceRe|cord *LP|
|00002de0| 2c 73 68 6f 72 74 20 66 | 6c 61 67 73 29 3b 0d 44 |,short f|lags);.D|
|00002df0| 65 73 63 72 69 70 74 69 | 6f 6e 20 2a 44 65 73 63 |escripti|on *Desc|
|00002e00| 72 69 62 65 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ribeLumi|nanceRec|
|00002e10| 6f 72 64 28 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ord(Lumi|nanceRec|
|00002e20| 6f 72 64 20 2a 4c 50 29 | 3b 0d 0d 23 65 6e 64 69 |ord *LP)|;..#endi|
|00002e30| 66 20 2f 2a 20 5f 4c 55 | 4d 49 4e 41 4e 43 45 5f |f /* _LU|MINANCE_|
|00002e40| 20 2a 2f 0d 0d 00 00 00 | 00 00 00 00 00 00 00 00 | */.....|........|
|00002e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002e80| 00 00 01 00 00 00 01 76 | 00 00 00 76 00 00 00 52 |.......v|...v...R|
|00002e90| 00 00 00 1c 0a 22 00 03 | 43 4f 44 45 00 1a 00 22 |....."..|CODE..."|
|00002ea0| 53 54 52 20 00 b5 01 66 | 63 6d 64 6f 00 00 09 ee |STR ...f|cmdo....|
|00002eb0| 0b 4c 75 6d 69 6e 61 6e | 63 65 2e 68 02 00 00 00 |.Luminan|ce.h....|
|00002ec0| 54 45 58 54 43 57 49 45 | 01 00 00 78 03 00 00 00 |TEXTCWIE|...x....|
|00002ed0| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 78 03 00 |..TEXTCW|IE...x..|
|00002ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ef0| 00 00 a1 08 e9 a2 00 00 | 2d c5 00 00 01 c8 00 00 |........|-.......|
|00002f00| 00 06 00 22 20 01 63 50 | 00 00 00 00 00 07 00 27 |..." .cP|.......'|
|00002f10| 20 01 b3 10 00 00 00 00 | 00 08 00 2f 20 01 c8 10 | .......|.../ ...|
|00002f20| 00 00 00 00 00 09 00 35 | 20 02 15 dc 00 00 00 00 |.......5| .......|
|00002f30| 00 0a 00 3b 20 02 47 b4 | 00 00 00 00 00 0b 00 40 |...; .G.|.......@|
|00002f40| 20 02 98 26 00 00 00 00 | 00 0c 00 49 20 02 e7 66 | ..&....|...I ..f|
|00002f50| 00 00 00 00 00 0d 00 4e | 20 03 62 92 00 00 00 00 |.......N| .b.....|
|00002f60| 00 0e 00 57 20 03 dd 0a | 00 00 00 00 00 0f 00 5c |...W ...|.......\|
|00002f70| 20 04 18 02 00 00 00 00 | 00 10 00 61 20 04 4c e0 | .......|...a .L.|
|00002f80| 00 00 00 1e 00 2a 00 03 | 01 d1 01 ff 00 2a 00 03 |.....*..|.....*..|
|00002f90| 01 6b 01 3a 00 00 00 00 | 00 00 00 00 00 00 00 00 |.k.:....|........|
|00002fa0| 00 00 00 00 00 48 00 09 | 4d 6f 6e 61 63 6f 00 00 |.....H..|Monaco..|
|00002fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002fc0| 00 00 00 00 00 00 00 00 | 00 03 00 04 00 57 00 19 |........|.....W..|
|00002fd0| 01 9d 02 83 00 57 00 19 | 01 9d 02 83 ac 9a 11 6e |.....W..|.......n|
|00002fe0| 00 00 2d c3 00 00 2d c3 | 00 00 29 20 00 00 00 00 |..-...-.|..) ....|
|00002ff0| 00 04 00 01 00 01 00 00 | 01 00 00 00 01 76 00 00 |........|.....v..|
|00003000| 00 76 00 00 00 52 01 cb | ab f4 35 fc 00 00 00 1c |.v...R..|..5.....|
|00003010| 00 52 00 01 4d 50 53 52 | 00 01 00 12 4d 57 42 42 |.R..MPSR|....MWBB|
|00003020| 00 00 00 2a 03 f0 ff ff | 00 00 00 00 00 00 00 00 |...*....|........|
|00003030| 03 ed ff ff 00 00 00 22 | 00 00 00 00 03 f0 ff ff |......."|........|
|00003040| 00 00 00 6e 00 00 00 00 | 00 00 00 00 00 00 00 00 |...n....|........|
|00003050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+